Picture prediction method and related device

ABSTRACT

A picture prediction method includes: determining a reference block of a current block; obtaining location information and motion information of at least two feature points in the reference block; calculating motion information of each subblock in the current block based on the location information and the motion information of the at least two feature points in the reference block; and performing motion compensation prediction on each subblock in the current block based on the motion information of each subblock in the current block, to obtain a prediction block of the current block.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2018/071351 filed on Jan. 4, 2018, which claims priority toChinese Patent Application No. 201710005575.6, filed on Jan. 4, 2017,the disclosures of the aforementioned applications are incorporatedherein by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to the video coding and decoding field,and specifically, to a picture prediction method and a related device.

BACKGROUND

As photoelectric collection technologies develop and high-definitiondigital video requirements increasingly grow, video data volumes becomeincreasingly large, limited heterogeneous transmission bandwidth anddiversified video applications constantly impose a higher requirement onvideo coding efficiency, and formulation of a high efficiency videocoding (HEVC) standard is started as required.

A basic principle of video coding and compression is to eliminateredundancy as much as possible by using correlation between spacedomains, time domains, and code words. Currently, a popular practice isusing a block-based hybrid video coding framework, and video coding andcompression is implemented by performing steps such as prediction(including intra-frame prediction and inter-frame prediction),conversion, quantization, and entropy encoding. This encoding frameworkshows very strong vitality, and HEVC still uses this block-based hybridvideo coding framework.

In various video coding/decoding solutions, motion estimation/motioncompensation is a key technology affecting encoding/decodingperformance. In many existing video coding/decoding solutions, it isusually assumed that a motion of an object satisfies a translationalmotion and various parts of the entire object have the same motion.Existing motion estimation/motion compensation algorithms are almostbloc-based motion compensation algorithms based on a translationalmotion model. Existing inter-frame prediction is mainly block-basedmotion compensation prediction based on a translational motion model.Some non-translational motion models (for example, an affine motionmodel) designed for a non-translational motion are gradually provided.

It is found in practice that in a conventional prediction mechanismbased on an affine motion model, precision of predicting a current blockby using a reference block is sometimes relatively low. Consequently, itis difficult to satisfy a high-precision prediction requirement in somescenarios.

SUMMARY

Embodiments of the present disclosure provide a picture predictionmethod and a related device, to improve precision of predicting acurrent block by using a reference block.

According to a first aspect, a picture prediction method is provided.The method includes:

determining, by a picture prediction apparatus, a reference block of acurrent block, where the reference block and the current block arespatially adjacent, and the reference block is predicted by using anaffine motion model; obtaining location information and motioninformation of at least two feature points in the reference block, wherethe at least two feature points are located in subblocks in which atleast two control points in the reference block are located, the atleast two control points are control points used in the affine motionmodel used for the reference block (that is, the at least two controlpoints are control points used in the affine motion model used topredict the reference block), and motion information of the subblock inwhich the feature point is located is obtained based on the motioninformation of the corresponding feature point (for example, the motioninformation of the feature point is used as the motion information ofthe subblock in which the feature point is located); calculating, by thepicture prediction apparatus, motion information of each subblock in thecurrent block based on the location information and the motioninformation of the at least two feature points in the reference block;and performing, by the picture prediction apparatus, motion compensationprediction on each subblock in the current block based on the motioninformation of each subblock in the current block, to obtain aprediction block of the current block.

In one embodiment, the motion information is, for example, a motionvector. In one embodiment, the location information is, for example,coordinates.

In one embodiment, the affine motion model used for the reference blockis, for example, the same as or similar to an affine motion model usedfor the current block. “The affine motion model used for the referenceblock” is the affine motion model used to predict the reference block.“The affine motion model used for the current block” is an affine motionmodel used to predict the current block.

The reference block of the current block may be, for example, a pictureblock adjacent to an upper left vertex of the current block, a pictureblock adjacent to a lower left vertex of the current block, a pictureblock adjacent to an upper right vertex of the current block, or apicture block adjacent to a lower right vertex of the current block.Certainly, the reference block of the current block may alternativelybe, for example, another picture block adjacent to the current block.

As can be learned, in the foregoing technical solution, the motioninformation of each subblock in the current block is calculated based onthe location information and the motion information of the at least twofeature points in the current block. In addition, the at least twofeature points are located in the subblocks in which the at least twocontrol points in the reference block are located, the at least twocontrol points are the control points used in the affine motion modelused to predict the reference block, and the motion information of thesubblock in which the feature point is located is obtained based on themotion information of the corresponding feature point. Therefore, thelocation information and the motion information of the feature point inthe reference block that are used to calculate the motion information ofeach subblock in the current block are matched at a relatively highdegree. It is found in practice that this helps improve accuracy ofcalculating the motion information of each subblock in the currentblock, thereby improving precision of predicting the current block byusing the reference block.

The picture prediction method provided in this embodiment may be appliedto a video coding process or a video decoding process.

According to a second aspect, a picture prediction apparatus is furtherprovided. The apparatus includes:

a determining unit configured to determine a reference block of acurrent block, where the reference block and the current block arespatially adjacent, and the reference block is predicted by using anaffine motion model;

an obtaining unit configured to obtain location information and motioninformation of at least two feature points in the reference block, wherethe at least two feature points are located in subblocks in which atleast two control points in the reference block are located, the atleast two control points are control points used in the affine motionmodel used for the reference block, and motion information of thesubblock in which the feature point is located is obtained based onmotion information of the corresponding feature point;

a calculation unit configured to calculate motion information of eachsubblock in the current block based on the location information and themotion information of the at least two feature points in the referenceblock; and

a prediction unit configured to perform motion compensation predictionon each subblock in the current block based on the motion information ofeach subblock in the current block, to obtain a prediction block of thecurrent block.

The picture prediction apparatus provided in this embodiment is appliedto a video coding apparatus or a video decoding apparatus. The videocoding apparatus or the video decoding apparatus may be any apparatusthat needs to output or store a video, for example, a device such as anotebook computer, a tablet computer, a personal computer, a mobilephone, or a video server.

The video coding apparatus and the video decoding apparatus may performsubblock division based on a same block division manner agreed on.Alternatively, the video coding apparatus may write a block divisionmanner indication to a bitstream, to notify the video decoding apparatusof a block division manner used by the video coding apparatus, so thatthe video coding apparatus and the video decoding apparatus use the sameblock division manner.

With reference to the technical solution according to either of theforegoing aspects, in some embodiments, the feature point is in acentral location of the subblock in which the control point in thereference block is located. In other words, the feature point may be apixel in the central location of the subblock in which the feature pointis located. It is found in practice that if motion information (e.g., amotion vector) of the pixel in the central location of the subblock isused as the motion information of the subblock, better predictionprecision is desirably obtained.

With reference to the technical solution according to either of theforegoing aspects, in some embodiments, the location information of thefeature point in the reference block is obtained by offsetting locationinformation of the control point in the reference block in the followingmanner: (x′,y′)=(x+a,y+b).

(x,y) are coordinates of a control point in the reference block, (x′,y′)are coordinates of a feature point in a subblock in which the controlpoint whose coordinates are (x,y) in the reference block is located, ais a horizontal offset, b is a vertical offset, and a and b are notequal to 0.

With reference to the technical solution according to either of theforegoing aspects, in some embodiments, the at least two control pointsin the reference block include at least two of an upper left vertex, anupper right vertex, a lower left vertex, and a lower right vertex of thereference block. When location coordinates of the upper left vertex ofthe reference block are (x₀,y₀), a width of the reference block is w,and a height of the reference block is h,

$\{ {\begin{matrix}{( {x_{1},y_{1}} ) = ( {{x_{0} + w},y_{0}} )} \\{( {x_{2},y_{2}} ) = ( {x_{0},{y_{0} + h}} )} \\{( {x_{3},y_{3}} ) = ( {{x_{0} + w},{y_{0} + h}} )}\end{matrix},} $

where (x₁,y₁) are coordinates of the upper right vertex of the referenceblock, (x₂,y₂) are coordinates of the lower left vertex of the referenceblock, and (x₃,y₃) are coordinates of the lower right vertex of thereference block.

For example, in some possible implementations, the at least two featurepoints may include feature points whose coordinates are respectively(x₀′,y₀′) and (x₁′,y₁′) in the reference block, where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, and w is the width of the reference block.

For another example, in some possible implementations, the at least twofeature points may include feature points whose coordinates arerespectively (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the reference block,where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, (x₂,y₂) are coordinates of a control pointin a subblock in which the feature point (x₂′,y₂′) in the referenceblock is located, w is the width of the reference block, and h is theheight of the reference block.

For another example, in some possible implementations, the at least twofeature points include feature points whose coordinates are respectively(x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in the reference block,where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{3} - {N_{1}/2}},{y_{3} - {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, (x₂,y₂) are coordinates of a control pointin a subblock in which the feature point (x₂′,y₂′) in the referenceblock is located, w is the width of the reference block, and h is theheight of the reference block.

In some embodiments, the calculating motion information of each subblockin the current block based on the location information and the motioninformation of the at least two feature points in the reference blockincludes: calculating the motion information of each subblock in thecurrent block based on the location information and the motioninformation of the at least two feature points in the reference blockand location information of each subblock in the current block.

For example, the calculating the motion information of each subblock inthe current block based on the location information and the motioninformation of the at least two feature points in the reference blockand location information of each subblock in the current block includes:calculating the motion information of each subblock in the current blockwith reference to the following formula and based on the locationinformation and the motion information of the at least two featurepoints in the reference block and the location information of eachsubblock in the current block:

$\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}\end{matrix},} } } $

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) and (x₁′,y₁′) in the reference block;

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in thereference block, where

vx₀ is a horizontal motion vector of the feature point (x₀′,y₀′), vy₀ isa vertical motion vector of the feature point (x₀′,y₀′); vx₁ is ahorizontal motion vector of the feature point (x₁′,y₁′), vy₁ is avertical motion vector of the feature point (x₁′,y₁′), vy₂ is a verticalmotion vector of the feature point (x₂′,y₂′), vx₂ is a horizontal motionvector of the feature point (x₂′,y₂′), vy₃ is a vertical motion vectorof the feature point (x₃′,y₃′), and vx₃ is a horizontal motion vector ofthe feature point (x₃,y₃′); and

vx is a horizontal motion vector of a subblock whose coordinates are(x,y) in the current block, and vy is a vertical motion vector of thesubblock whose coordinates are (x,y) in the current block.

In some embodiments, the calculating motion information of each subblockin the current block based on the location information and the motioninformation of the at least two feature points in the reference blockincludes: calculating, based on the location information and the motioninformation of the at least two feature points in the reference block,motion information of at least two control points used in an affinemotion model used for the current block; and calculating the motioninformation of each subblock in the current block based on locationinformation of each subblock in the current block and the motioninformation and location information of the at least two control pointsused in the affine motion model used for the current block.

The at least two control points used in the affine motion model used forthe current block may include, for example, at least two of the upperleft vertex, the lower left vertex, the upper right vertex, and thelower right vertex of the current block.

For example, the calculating, based on the location information and themotion information of the at least two feature points in the referenceblock, the motion information of at least two control points used in anaffine motion model used for the current block includes: calculating,with reference to the following formula and based on the locationinformation and the motion information of the at least two featurepoints in the reference block, the motion information of the at leasttwo control points used in the affine motion model used for the currentblock:

$\begin{matrix}\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - y_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ \begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}\end{matrix}  & \; \\\{ \begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}\end{matrix}  & \; \\\{ \begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime\;}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{7} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime\;}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vx}_{0}} \\{{vy}_{7} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vy}_{0}}\end{matrix},}  & \;\end{matrix}$

where the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) and (x₁′,y₁′) in the reference block;

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in thereference block, where

the at least two control points used in the affine motion model used forthe current block include control points whose coordinates arerespectively (x₄,y₄) and (x₅,y₅) in the current block; the at least twocontrol points used in the affine motion model used for the currentblock include control points whose coordinates are respectively (x₄,y₄),(x₅,y₅), and (x₆,y₆) in the current block; or the at least two controlpoints used in the affine motion model used for the current blockinclude control points whose coordinates are respectively (x₄,y₄),(x₅,y₅), (x₆,y₆) and (x₇,y₇) in the current block; and

vx₄ is a horizontal motion vector of the control point (x₄,y₄), vy₄ is avertical motion vector of the control point (x₄,y₄); vx₅ is a horizontalmotion vector of the control point (x₅,y₅) vy₅ is a vertical motionvector of the control point (x₅,y₅), vx₆ is a horizontal motion vectorof the control point (x₆,y₆), vy₆ is a vertical motion vector of thecontrol point (x₆,y₆), vx₇ is a horizontal motion vector of the controlpoint (x₇,y₇), and vy₇ is a vertical motion vector of the control point(x₇,y₇).

For example, the calculating the motion information of each subblock inthe current block based on location information of each subblock in thecurrent block and the motion information and location information of theat least two control points used in the affine motion model used for thecurrent block includes: calculating the motion information of eachsubblock in the current block with reference to the following formulaand based on the location information of each subblock in the currentblock and the motion information and the location information of the atleast two control points used in the affine motion model used for thecurrent block:

$\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} - {\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vx}_{7} + {vx}_{4}} ) - ( {{vx}_{5} + {vx}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vy}_{7} + {vy}_{4}} ) - ( {{vy}_{5} + {vy}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix},}  & \;\end{matrix}$

where vx is a horizontal motion vector of a subblock whose coordinatesare (x,y) in the current block, and vy is a vertical motion vector ofthe subblock whose coordinates are (x,y) in the current block.

According to a third aspect, a picture prediction apparatus is furtherprovided. The apparatus includes: a processor and a storage componentcoupled to each other. The processor is configured to invoke code storedin the memory/storage component, to perform some or all steps in anypicture prediction method according to the embodiments of the presentdisclosure.

According to a fourth aspect, a video system is provided. The systemincludes: a video coding apparatus and a video decoding apparatus. Thevideo coding apparatus or the video decoding apparatus is configured toperform some or all steps in any picture prediction method according tothe embodiments of the present disclosure.

In addition, according to a fifth aspect, a computer-readable storagemedium is provided. The computer-readable storage medium stores programcode. The program code includes an instruction used to perform some orall steps in any picture prediction method according to the embodimentsof the present disclosure.

In addition, according to a sixth aspect, a computer program product isprovided. When the computer program product runs on a computer, thecomputer is enabled to perform some or all steps in any pictureprediction method according to the embodiments of the presentdisclosure.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentdisclosure more clearly, the following briefly describes theaccompanying drawings required for describing the embodiments.Apparently, the accompanying drawings in the following description showmerely some embodiments of the present disclosure, and a person ofordinary skill in the art may derive other drawings from theseaccompanying drawings without creative efforts.

FIG. 1-a and FIG. 1-b are several schematic diagrams of dividing apicture block according to one embodiment;

FIG. 1-c is a schematic diagram of inter-frame prediction according toone embodiment;

FIG. 2 is a schematic flowchart of a picture prediction method accordingto one embodiment;

FIG. 3-a is a schematic flowchart of another picture prediction methodaccording to one embodiment;

FIG. 3-b is a schematic diagram of a possible location of a referenceblock according to one embodiment;

FIG. 3-c to FIG. 3-e are schematic diagrams of reference blocksaccording to one embodiment;

FIG. 3-f and FIG. 3-g are schematic diagrams of subblock division ofreference blocks according to one embodiment;

FIG. 3-h is a schematic diagram of a possible positional relationshipbetween a control point and a feature point in a reference blockaccording to one embodiment;

FIG. 3-i is a schematic diagram of several non-translational motionsaccording to one embodiment;

FIG. 4 is a schematic flowchart of another picture prediction methodaccording to one embodiment;

FIG. 5 is a schematic flowchart of another picture prediction methodaccording to one embodiment;

FIG. 6 is a schematic flowchart of another picture prediction methodaccording to one embodiment;

FIG. 7 is a schematic diagram of a picture prediction apparatusaccording to one embodiment;

FIG. 8 is a schematic diagram of another picture prediction apparatusaccording to one embodiment;

FIG. 9-A is a schematic diagram of a video encoder according to oneembodiment;

FIG. 9-B is a schematic diagram of a video decoder according to oneembodiment;

FIG. 10 is a schematic block diagram of an electronic apparatusaccording to one embodiment;

FIG. 11 is another schematic block diagram of an electronic apparatusaccording to one embodiment;

FIG. 12 is a schematic structural diagram of a television applicationaccording to one embodiment; and

FIG. 13 is a schematic structural diagram of a mobile phone applicationaccording to one embodiment.

DESCRIPTION OF EMBODIMENTS

The embodiments of the present disclosure provide a picture predictionmethod and a related device.

In the specification, claims, and accompanying drawings of the presentdisclosure, the terms “first”, “second”, “third”, and so on are intendedto distinguish between different objects but do not indicate aparticular order. In addition, the terms “including”, “having”, or anyother variant thereof, are intended to cover non-exclusive inclusion.For example, a process, a method, a system, a product, or a device thatincludes a series of steps or units is not limited to the listed stepsor units, but optionally further includes an unlisted step or unit, oroptionally further includes another inherent step or unit of theprocess, the method, the product, or the device.

The following first briefly describes some concepts that may bementioned in the embodiments of the present disclosure.

In most encoding frameworks, a video sequence includes a series ofpictures, the picture is further divided into slices, and the slice isfurther divided into blocks. Video coding is performed on a per-blockbasis, and encoding processing may be performed from an upper leftcorner of a picture row by row from left to right and from top tobottom. In some new video coding standards, the concept of block isfurther extended. In the H.264 standard, there is a macroblock (MB), andthe MB may be further divided into a plurality of prediction blocks thatmay be used for predictive coding. In the HEVC standard, basic conceptssuch as a coding unit (CU), a prediction unit (PU), and a transform unit(TU) are used, a plurality of units are obtained by division based onfunctions, and a new tree-based structure is used for description. Forexample, the CU may be divided into smaller CUs based on a quadtree, andthe smaller CU may continue to be divided to form a quadtree structure.The PU and the TU also have a similar tree structure. All the CU, thePU, and the TU essentially belong to the concept of block. The CU issimilar to a macroblock MB or an encoding block and is a basic unit fordividing and encoding an encoding picture. The PU may correspond to aprediction block and is a basic unit for predictive coding. The CU isfurther divided into a plurality of PUs based on a division mode. The TUmay correspond to a transformation block and is a basic unit fortransforming a prediction residual. In the High Efficiency Video Coding(HEVC) standard, the CU, the PU, and the TU may be collectively referredto as a coding tree block (CTB) or the like.

In the HEVC standard, sizes of coding units may include four levels:64×64, 32×32, 16×16, and 8×8, and a coding unit at each level may bedivided into prediction units with different sizes based on intra-frameprediction and inter-frame prediction. For example, as shown in FIG. 1-aand FIG. 1-b, FIG. 1-a shows an example of a prediction unit divisionmanner corresponding to intra-frame prediction, and FIG. 1-b shows anexample of several prediction unit division manners corresponding tointer-frame prediction. FIG. 1-c is a schematic diagram of inter-frameprediction. Existing inter-frame prediction is mainly block-based motioncompensation prediction based on a translational motion model. Somenon-translational motion models (for example, an affine motion model)designed for a non-translational motion are also gradually provided.FIG. 3-i shows examples of non-translational motion manners such as arotation motion, a scaling motion, and an affine motion.

In a development and evolution process of video coding technologies,video coding experts in the art strive to improve encoding efficiency byusing time and spatial correlation between adjacent encodingblocks/decoding blocks with various methods. For example, in theH264/advanced video coding (AVC) standard, skip mode encoding and directmode encoding become effective tools for improving encoding efficiency.A block using these two encoding modes at a low bit rate may usuallyoccupy more than half of an entire encoding sequence. When the skip modeis used for encoding, a skip mode tag is transferred in a bitstream, amotion vector of a current picture block may be derived by using asurrounding motion vector, and a value of a reference block is directlycopied as a reconstruction value of the current picture block based onthe motion vector. When the direct mode is used for encoding, an encodermay derive a motion vector of a current picture block by using asurrounding motion vector, directly copy a value of a reference block asa predictor of the current picture block based on the motion vector, andencode and predict the current picture block on an encoder side by usingthe predictor.

The following continues to discuss technical solutions in theembodiments of the present disclosure.

The following first describes a picture prediction method provided inthe embodiments of the present disclosure. The picture prediction methodprovided in the embodiments of the present disclosure is performed by avideo coding apparatus or a video decoding apparatus. The video codingapparatus or the video decoding apparatus may be any apparatus thatneeds to output or store a video, for example, a device such as anotebook computer, a tablet computer, a personal computer, a mobilephone, or a video server.

FIG. 2 is a schematic flowchart of a picture prediction method accordingto one embodiment. As shown in the example in FIG. 2, the pictureprediction method may include:

S201: A picture prediction apparatus determines a reference block of acurrent block.

The reference block (that is, a reference picture block) and the currentblock (that is, a current picture block) are spatially adjacent. Thereference block is predicted (e.g., motion compensation prediction) byusing an affine motion model. For example, on an encoder side or adecoder side, a picture block may be selected as the reference block ofthe current block based on a preset selection policy from blocksspatially adjacent to the current block.

The reference block of the current block may be, for example, a pictureblock adjacent to an upper left vertex of the current block, a pictureblock adjacent to a lower left vertex of the current block, a pictureblock adjacent to an upper right vertex of the current block, or apicture block adjacent to a lower right vertex of the current block.Certainly, the reference block of the current block may alternativelybe, for example, another picture block adjacent to the current block.

S202: The picture prediction apparatus obtains location information andmotion information of at least two feature points in the referenceblock.

The at least two feature points are located in subblocks in which atleast two control points in the reference block are located. The atleast two control points are control points used in the affine motionmodel used for the reference block. Motion information of the subblockin which the feature point is located is obtained based on the motioninformation of the corresponding feature point (for example, the motioninformation of the feature point is used as the motion information ofthe subblock in which the feature point is located).

It may be understood that the at least two feature points may be, forexample, two, three, four, or another quantity of feature points.

It may be understood that the at least two control points may be, forexample, two, three, four, or another quantity of control points.

For example, the control points used in the affine motion model used topredict the reference block may include at least two of an upper leftvertex, a lower left vertex, an upper right vertex, and a lower rightvertex of the reference block. When location coordinates of the upperleft vertex of the reference block are (x₀,y₀), a width of the referenceblock is w, and a height of the reference block is h,

$\{ {\begin{matrix}{( {x_{1},y_{1}} ) = ( {{x_{0} + w},y_{0}} )} \\{( {x_{2},y_{2}} ) = ( {x_{0},{y_{0} + h}} )} \\{( {x_{3},y_{3}} ) = ( {{x_{0} + w},{y_{0} + h}} )}\end{matrix},} $

where (x₁,y₁) are coordinates of the upper right vertex of the referenceblock, (x₂,y₂) are coordinates of the lower left vertex of the referenceblock, and (x₃,y₃) are coordinates of the lower right vertex of thereference block.

For example, the feature point may be in a central location of thesubblock in which the control point in the reference block is located.In other words, the feature point may be a pixel in the central locationof the subblock in which the feature point is located. It is found inpractice that if motion information (a motion vector) of the pixel inthe central location of the subblock is used as the motion informationof the subblock, better prediction precision is desirably obtained.

For example, assuming that the control points used in the affine motionmodel used to predict the reference block include the upper left vertex,the lower left vertex, and the upper right vertex, the at least twofeature points in the reference block, for example, may include at leasttwo of the following pixels: a pixel in a central location of a subblockin which the upper left vertex of the reference block is located, apixel in a central location of a subblock in which the lower left vertexis located, and a pixel in a central location of a subblock in which theupper right vertex is located.

In one embodiment, the motion information is, for example, a motionvector. In one embodiment, the location information is, for example,coordinates.

In one embodiment, the affine motion model used to predict the referenceblock is, for example, the same as or similar to an affine motion modelused to predict the current block.

The location information of the at least two feature points (the atleast two feature points are, for example, two, three, or four featurepoints) used in the affine motion model used for the reference block maybe obtained by offsetting location information of the control points inthe reference block in the following manner: (x′,y′)=(x+a,y+b). (x,y)are coordinates of a control point in the reference block (x is ahorizontal coordinate and y is a vertical coordinate), (x′,y′) arecoordinates of a feature point corresponding to the control point whosecoordinates are (x,y) in the reference block (x′ is a horizontalcoordinate and y′ is a vertical coordinate), a is a horizontal offset, bis a vertical offset, and a and b are not equal to 0.

For example, a may be equal to 1, 2, 3, 4, 5, 6, 7, −1, −2, −3, −4, −5,or another value.

For example, b may be equal to 1, 2, 3, 4, 5, 6, 7, −1, −2, −3, −4, −5,or another value.

S203: The picture prediction apparatus calculates motion information ofeach subblock in the current block based on the location information andthe motion information of the at least two feature points in thereference block.

For example, the calculating motion information of each subblock in thecurrent block based on the location information and the motioninformation of the at least two feature points in the reference blockincludes: calculating the motion information of each subblock in thecurrent block based on the location information and the motioninformation of the at least two feature points in the reference blockand location information of each subblock in the current block.

For another example, the calculating motion information of each subblockin the current block based on the location information and the motioninformation of the at least two feature points in the reference blockincludes: calculating, based on the location information and the motioninformation of the at least two feature points in the reference block,motion information of at least two control points used in an affinemotion model used for the current block; and calculating the motioninformation of each subblock in the current block based on locationinformation of each subblock in the current block and the motioninformation and location information of the at least two control pointsused in the affine motion model used for the current block.

S204: The picture prediction apparatus performs motion compensationprediction on each subblock in the current block based on the motioninformation of each subblock in the current block, to obtain aprediction block of the current block.

As can be learned from the foregoing, in the solution provided in thisembodiment, the motion information of each subblock in the current blockis calculated based on the location information and the motioninformation of the at least two feature points in the current block. Inaddition, the at least two feature points are located in the subblocksin which the at least two control points in the reference block arelocated, the at least two control points are the control points used inthe affine motion model used to predict the reference block, and themotion information of the subblock in which the feature point is locatedis obtained based on the motion information of the corresponding featurepoint. Therefore, the location information and the motion information ofthe feature point in the reference block that are used to calculate themotion information of each subblock in the current block are matched ata relatively high degree. It is found in practice that this helpsimprove accuracy of calculating the motion information of each subblockin the current block, thereby improving precision of predicting thecurrent block by using the reference block.

For example, if the motion information of each subblock in the currentblock is calculated based on the motion information of the feature pointin the reference block and the location information of the controlpoint, because the motion information of the feature point and thelocation information of the control point are not matched (at least adegree of matching is lower than that of matching between the motioninformation and the location information of the feature point),precision of predicting the current block is probably affected.

The picture prediction method may be applied to a video coding processor the picture prediction method may be applied to a video decodingprocess.

For ease of better understanding the technical solutions in theembodiments of the present disclosure, the following provides detaileddescriptions of examples from the perspective of an encoder side and adecoder side.

FIG. 3-a is a schematic flowchart of another picture prediction methodaccording to one embodiment. As shown in the example in FIG. 3-a, theanother picture prediction method may include:

301: A video coding apparatus determines a reference block of a currentblock.

For example, as shown in FIG. 3-b, the video coding apparatus maytraverse, based on a sequence of pixel units A, B, C, D, and E, fivepicture blocks spatially adjacent to the current block, and may use, asthe reference block of the current block, a first found picture blockpredicted by using an affine motion model. Certainly, the video codingapparatus may alternatively use, as the reference block of the currentblock, any picture block that is predicted by using an affine motionmodel and that is of picture blocks in which the pixel units A, B, C, D,and E are located.

The pixel unit A and the pixel unit D are adjacent to a lower leftvertex of the current block, the pixel unit B and the pixel unit C areadjacent to an upper right vertex of the current block, and the pixelunit E is adjacent to an upper left vertex of the current block.

In one embodiment, the pixel unit may include one or more pixels. Forexample, the pixel unit may be a 2×2 pixel block, a 2×1 pixel block, a1×1 pixel block, a 4×4 pixel block, a 4×2 pixel block, or the like.

For example, the picture blocks in five locations spatially adjacent tothe current block are traversed based on the sequence of A, B, C, D, andE shown in FIG. 3-b. Assuming that the picture block in which the pixelunit A is located is predicted by using the affine motion model, asshown in the example in FIG. 3-c, the picture block in which the pixelunit A is located may be used as the reference block of the currentblock. Alternatively assuming that the picture block in which the pixelunit A is located is not predicted by using the affine motion model, andthe picture block in which the pixel unit B is located is predicted byusing the affine motion model, as shown in the example in FIG. 3-d, thepicture block in which the pixel unit B is located may be used as thereference block of the current block. Alternatively assuming thatneither of the picture blocks in which the pixel unit A and the pixelunit B are located is predicted by using the affine motion model, andthe picture block in which the pixel unit C is located is predicted byusing the affine motion model, as shown in the example in FIG. 3-e, thepicture block in which the pixel unit C is located may be used as thereference block of the current block. Alternatively assuming thatneither of the picture blocks in which the pixel unit A, the pixel unitB, and the pixel unit C are located is predicted by using the affinemotion model, and the picture block in which the pixel unit D is locatedis predicted by using the affine motion model, the picture block inwhich the pixel unit D is located may be used as the reference block ofthe current block. Alternatively assuming that neither of the pictureblocks in which the pixel unit A, the pixel unit B, the pixel unit C,and the pixel unit D are located is predicted by using the affine motionmodel, and the picture block in which the pixel unit E is located ispredicted by using the affine motion model, the picture block in whichthe pixel unit E is located may be used as the reference block of thecurrent block.

In addition, in some other possible implementations, when at least twoof the picture blocks in which the pixel units A, B, C, D, and E arelocated are predicted by using the affine motion model, the pictureblocks predicted by using the affine motion model may be used ascandidate reference blocks, prediction quality is separately calculatedwhen the current block is predicted by using the candidate referenceblocks, and a candidate reference block having best prediction qualityis used as the reference block of the current block.

Certainly, a mechanism of selecting the reference block of the currentblock is not limited to the foregoing examples. A decoder side selectsthe reference block of the current block by using a same policy as thatof an encoder side.

302: The video coding apparatus derives location information of at leasttwo feature points in the reference block by using subblock divisioninformation of the reference block and location information of at leasttwo control points used in an affine motion model used for the referenceblock.

The at least two feature points are located in subblocks in which the atleast two control points in the reference block are located, and motioninformation of the feature point is used as motion information of thesubblock in which the feature point is located.

It should be noted that the encoder side and the decoder side mayperform subblock division on the reference block in a same subblockdivision manner. For example, as shown in the example in FIG. 3-f, 4*4subblocks may be fixedly obtained by division. Alternatively, forexample, as shown in the example in FIG. 3-g, 8*8 subblocks may befixedly obtained by division. Certainly, a corresponding subblockdivision manner may alternatively be derived by using size informationof the reference block, vertex motion information, and the like. This isnot limited herein.

The following separately describes examples in which the at least twofeature points include two, three, and four feature points.

For example, the at least two feature points may include feature pointswhose coordinates are respectively (x₀′,y₀′) and (x₁′,y₁′) in thereference block, where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, and w is a width of the reference block.

For another example, the at least two feature points include the featurepoints whose coordinates are respectively (x₀′,y₀′), (x₁′,y₁′) and(x₂′,y₂′) in the reference block, where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, (x₂,y₂) are coordinates of a control pointin a subblock in which the feature point (x₂′,y₂′) in the referenceblock is located, w is a width of the reference block, and h is a heightof the reference block.

For another example, in some possible implementations, when the at leasttwo feature points include feature points whose coordinates arerespectively (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in thereference block, where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{3} - {N_{1}/2}},{y_{3} - {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, (x₂,y₂) are coordinates of a control pointin a subblock in which the feature point (x₂′,y₂′) in the referenceblock is located, (x₃,y₃) are coordinates of a control point in asubblock in which the feature point (x₃′,y₃′) in the reference block islocated, w is a width of the reference block, and h is a height of thereference block.

FIG. 3-h shows an example of a possible positional relationship betweena control point and a feature point in each subblock in the referenceblock. The control point is at a vertex of the subblock, a correspondingfeature point is in a central location of the subblock, and when thesubblock includes a plurality of central locations, the feature pointmay be in any central location of the subblock.

For example, the control points used in the affine motion model used topredict the reference block may include at least two of an upper leftvertex, a lower left vertex, an upper right vertex, and a lower rightvertex of the reference block. When location coordinates of the upperleft vertex of the reference block are (x₀,y₀), a width of the referenceblock is w, and a height of the reference block is h,

$\{ {\begin{matrix}{( {x_{1},y_{1}} ) = ( {{x_{0} + w},y_{0}} )} \\{( {x_{2},y_{2}} ) = ( {x_{0},{y_{0} + h}} )} \\{( {x_{3},y_{3}} ) = ( {{x_{0} + w},{y_{0} + h}} )}\end{matrix},} $

where (x₁,y₁) are coordinates of the upper right vertex of the referenceblock, (x₂,y₂) are coordinates of the lower left vertex of the referenceblock, and (x₃,y₃) are coordinates of the lower right vertex of thereference block.

Certainly, the positional relationship between the control point and thefeature point in the same subblock is not limited to the example shownin FIG. 3-h.

It may be understood that an implementation in which the at least twofeature points are in another case is deduced by analogy.

303: The video coding apparatus calculates motion information of eachsubblock in the current block based on the location information andmotion information of the at least two feature points in the referenceblock and location information of each subblock in the current block.

The motion information of each subblock in the current block may be usedas motion information of all pixels in the corresponding subblock.Location information of a central pixel of the subblock in the currentblock may be used as location information of the corresponding subblock.

For example, the motion information of each subblock in the currentblock may be calculated with reference to the following formula andbased on the location information and the motion information of the atleast two feature points in the reference block and the locationinformation of each subblock in the current block:

$\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},}  & \;\end{matrix}$

where the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) and (x₁′,y₁′) in the reference block;

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in thereference block, where

vx₀ is a horizontal motion vector of the feature point (x₀′,y₀′), vy₀ isa vertical motion vector of the feature point (x₀′,y₀′); vx₁ is ahorizontal motion vector of the feature point (x₁′,y₁′), vy₁ is avertical motion vector of the feature point (x₁′,y₁′), vy₂ is a verticalmotion vector of the feature point (x₂′,y₂′), vx₂ is a horizontal motionvector of the feature point (x₂′,y₂′), vy₃ is a vertical motion vectorof the feature point (x₃′,y₃′), and Vx₃ is a horizontal motion vector ofthe feature point (x₃′,y₃′); and

vx is a horizontal motion vector of a subblock whose coordinates are(x,y) in the current block, and vy is a vertical motion vector of thesubblock whose coordinates are (x,y) in the current block.

It should be noted that in this embodiment, an example in whichderivation is performed mainly based on motion information of two,three, and four feature points is used for description, and other casesmay be deduced by analogy.

S304: The video coding apparatus performs motion compensation predictionon each subblock in the current block based on the motion information ofeach subblock in the current block, to obtain a prediction block of thecurrent block. In one embodiment, a predictor of each pixel in eachsubblock is obtained by using the motion information of each subblock inthe current block, and motion compensation prediction is performed onthe predictor of each pixel in each subblock in the current block, toobtain the prediction block of the current block.

305: The video coding apparatus obtains a prediction residual of thecurrent block based on the prediction block of the current block. Thevideo coding apparatus may write the prediction residual of the currentpicture block to a video bitstream.

As can be learned from the foregoing, in the solution in thisembodiment, the video coding apparatus calculates the motion informationof each subblock in the current block based on the location informationand the motion information of the at least two feature points in thecurrent block. In addition, the at least two feature points are locatedin the subblocks in which the at least two control points in thereference block are located, the at least two control points are thecontrol points used in the affine motion model used to predict thereference block, and the motion information of the subblock in which thefeature point is located is obtained based on the motion information ofthe corresponding feature point. Therefore, the location information andthe motion information of the feature point in the reference block thatare used by the video coding apparatus to calculate the motioninformation of each subblock in the current block are matched at arelatively high degree. It is found in practice that this helps improveaccuracy of calculating the motion information of each subblock in thecurrent block, thereby improving precision of predicting the currentblock by using the reference block.

FIG. 4 is a schematic flowchart of another picture prediction methodaccording to one embodiment. As shown in the example in FIG. 4, theother picture prediction method may include:

401: A video coding apparatus determines a reference block of a currentblock.

402: The video coding apparatus derives location information of at leasttwo feature points in the reference block by using subblock divisioninformation of the reference block and location information of at leasttwo control points used in an affine motion model used for the referenceblock.

For specific implementations of step 401 and step 402, refer to relateddescriptions of step 301 and step 302, and details are not describedherein again.

403: The video coding apparatus calculates, based on the locationinformation and motion information of the at least two feature points inthe reference block, motion information of at least two control pointsused in an affine motion model used for the current block. Motioninformation of each subblock in the current block may be used as motioninformation of all pixels in the corresponding subblock. Locationinformation of a central pixel of the subblock in the current block maybe used as location information of the corresponding subblock.

For example, the motion information of the at least two control pointsused in the affine motion model used for the current block may becalculated with reference to the following formula and based on thelocation information and the motion information of the at least twofeature points in the reference block:

$\{ {\begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{7} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{7} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},} } } } } } } } } $

where the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) and (x₁′,y₁′) in the reference block;

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in thereference block, where

the at least two control points used in the affine motion model used forthe current block include control points whose coordinates arerespectively (x₄,y₄) and (x₅,y₅) in the current block, the at least twocontrol points used in the affine motion model used for the currentblock include control points whose coordinates are respectively (x₄,y₄),(x₅,y₅), and (x₆,y₆) in the current block; or the at least two controlpoints used in the affine motion model used for the current blockinclude control points whose coordinates are respectively (x₄,y₄),(x₅,y₅), (x₆,y₆), and (x₇,y₇) in the current block; and

vx₄ is a horizontal motion vector of the control point (x₄,y₄), vy₄ is avertical motion vector of the control point (x₄,y₄); vx₅ is a horizontalmotion vector of the control point (x₅,y₅), vy₅ is a vertical motionvector of the control point (x₅,y₅), vx₆ is a horizontal motion vectorof the control point (x₆,y₆), vy₆ is a vertical motion vector of thecontrol point (x₆,y₆), vx₇ is a horizontal motion vector of the controlpoint (x₇,y₇), and vy₇ is a vertical motion vector of the control point(x₇,y₇).

It should be noted that in this embodiment, an example in whichderivation is performed mainly based on motion information of two,three, and four feature points is used for description, and other casesmay be deduced by analogy.

404: The video coding apparatus calculates motion information of eachsubblock in the current block based on location information of eachsubblock in the current block and the motion information and locationinformation of the at least two control points used in the affine motionmodel used for the current block.

For example, the motion information of each subblock in the currentblock may be calculated with reference to the following formula andbased on the location information of each subblock in the current blockand the motion information and the location information of the at leasttwo control points used in the affine motion model used for the currentblock:

$\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} - {\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}{\mspace{11mu}\;}{or}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}{\mspace{11mu}\;}{or}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{7}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vx}_{7} + {vx}_{4}} ) - ( {{vx}_{5} + {vx}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{7}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vy}_{7} + {vy}_{4}} ) - ( {{vy}_{5} + {vy}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix},} } } $

where vx is a horizontal motion vector of a subblock whose coordinatesare (x,y) in the current block, and is a vertical motion vector of thesubblock whose coordinates are (x,y) in the current block.

405: The video coding apparatus performs motion compensation predictionon each subblock in the current block based on the motion information ofeach subblock in the current block, to obtain a prediction block of thecurrent block.

In one embodiment, a predictor of each pixel in each subblock isobtained by using the motion information of each subblock in the currentblock, and motion compensation prediction is performed on the predictorof each pixel in each subblock in the current block, to obtain theprediction block of the current block.

406: The video coding apparatus obtains a prediction residual of thecurrent block based on the prediction block of the current block. Thevideo coding apparatus may write the prediction residual of the currentpicture block to a video bitstream.

As can be learned from the foregoing, in the solution in thisembodiment, the video coding apparatus calculates the motion informationof the at least two control points used in the affine motion model usedfor the current block based on the location information and the motioninformation of the at least two feature points in the current block, andcalculates the motion information of each subblock in the current blockbased on the motion information of the at least two control points usedin the affine motion model used for the current block. In addition, theat least two feature points are located in the subblocks in which the atleast two control points in the reference block are located, the atleast two control points are the control points used in the affinemotion model used to predict the reference block, and the motioninformation of the subblock in which the feature point is located isobtained based on the motion information of the corresponding featurepoint. Therefore, the location information and the motion information ofthe feature point in the reference block that are used by the videocoding apparatus to calculate the motion information of each subblock inthe current block may be matched at a relatively high degree. It isfound in practice that this helps improve accuracy of calculating themotion information of each subblock in the current block, therebyimproving precision of predicting the current block by using thereference block.

FIG. 5 is a schematic flowchart of another picture prediction methodaccording to one embodiment. As shown in the example in FIG. 5, theother picture prediction method may include:

501: A video decoding apparatus determines a reference block of acurrent block.

The reference block is spatially adjacent to the current block, and thereference block is predicted by using an affine motion model.

502: The video decoding apparatus derives location information of atleast two feature points in the reference block by using subblockdivision information of the reference block and location information ofat least two control points used in an affine motion model used for thereference block.

The at least two feature points are located in subblocks in which the atleast two control points in the reference block are located, and motioninformation of the feature point is used as motion information of thesubblock in which the feature point is located.

It should be noted that an encoder side and a decoder side may performsubblock division on the reference block in a same subblock divisionmanner. For example, the reference block may be fixedly divided into 4*4or 8*8 subblocks. Certainly, a corresponding subblock division mannermay alternatively be derived by using size information of the referenceblock, vertex motion information, and the like. This is not limitedherein.

503: The video decoding apparatus calculates motion information of eachsubblock in the current block based on the location information andmotion information of the at least two feature points in the referenceblock and location information of each subblock in the current block.

Motion information of each subblock in the current block may be used asmotion information of all pixels in the corresponding subblock. Locationinformation of a central pixel of the subblock in the current block maybe used as location information of the corresponding subblock.

504: The video decoding apparatus performs motion compensationprediction on each subblock in the current block based on the motioninformation of each subblock in the current block, to obtain aprediction block of the current block.

In one embodiment, a predictor of each pixel in each subblock isobtained by using the motion information of each subblock in the currentblock, and motion compensation prediction is performed on the predictorof each pixel in each subblock in the current block, to obtain theprediction block of the current block.

For specific implementations of step 501 to step 504, refer to relateddescriptions of step 301 to step 304, and details are not describedherein again.

505: The video decoding apparatus reconstructs the current block basedon the prediction block of the current block and a correspondingprediction residual in a video bitstream.

As can be learned from the foregoing, in the solution in thisembodiment, the video decoding apparatus calculates the motioninformation of each subblock in the current block based on the locationinformation and the motion information of the at least two featurepoints in the current block. In addition, the at least two featurepoints are located in the subblocks in which the at least two controlpoints in the reference block are located, the at least two controlpoints are the control points used in the affine motion model used topredict the reference block, and the motion information of the subblockin which the feature point is located is obtained based on the motioninformation of the corresponding feature point. Therefore, the locationinformation and the motion information of the feature point in thereference block that are used by the video decoding apparatus tocalculate the motion information of each subblock in the current blockare matched at a relatively high degree. It is found in practice thatthis helps improve accuracy of calculating the motion information ofeach subblock in the current block, thereby improving precision ofpredicting the current block by using the reference block.

FIG. 6 is a schematic flowchart of another picture prediction methodaccording to one embodiment. As shown in the example in FIG. 6, theother picture prediction method may include:

601: A video decoding apparatus determines a reference block of acurrent block. The reference block is spatially adjacent to the currentblock, and the reference block is predicted by using an affine motionmodel.

602: The video decoding apparatus derives location information of atleast two feature points in the reference block by using subblockdivision information of the reference block and location information ofat least two control points used in the affine motion model used for thereference block.

603: The video decoding apparatus calculates, based on the locationinformation and motion information of the at least two feature points inthe reference block, motion information of at least two control pointsused in an affine motion model used for the current block.

Motion information of each subblock in the current block may be used asmotion information of all pixels in the corresponding subblock. Locationinformation of a central pixel of the subblock in the current block maybe used as location information of the corresponding subblock.

604: The video decoding apparatus calculates motion information of eachsubblock in the current block based on location information of eachsubblock in the current block and the motion information and locationinformation of the at least two control points used in the affine motionmodel used for the current block.

For specific implementations of step 601 to step 604, refer to relateddescriptions of step 401 and step 404, and details are not describedherein again.

605: The video decoding apparatus performs motion compensationprediction on each subblock in the current block based on the motioninformation of each subblock in the current block, to obtain aprediction block of the current block.

In one embodiment, a predictor of each pixel in each subblock isobtained by using the motion information of each subblock in the currentblock, and motion compensation prediction is performed on the predictorof each pixel in each subblock in the current block, to obtain theprediction block of the current block.

606: The video decoding apparatus reconstructs the current block basedon the prediction block of the current block and a correspondingprediction residual in a video bitstream.

As can be learned from the foregoing, in the solution in thisembodiment, the video decoding apparatus calculates the motioninformation of the at least two control points used in the affine motionmodel used for the current block based on the location information andthe motion information of the at least two feature points in the currentblock, and calculates the motion information of each subblock in thecurrent block based on the motion information of the at least twocontrol points used in the affine motion model used for the currentblock. In addition, the at least two feature points are located in thesubblocks in which the at least two control points in the referenceblock are located, the at least two control points are the controlpoints used in the affine motion model used to predict the referenceblock, and the motion information of the subblock in which the featurepoint is located is obtained based on the motion information of thecorresponding feature point. Therefore, the location information and themotion information of the feature point in the reference block that areused by the video decoding apparatus to calculate the motion informationof each subblock in the current block is matched at a relatively highdegree. It is found in practice that this helps improve accuracy ofcalculating the motion information of each subblock in the currentblock, thereby improving precision of predicting the current block byusing the reference block.

The following further provides a related apparatus configured toimplement the foregoing solution.

Referring to FIG. 7, in one embodiment, a picture prediction apparatusis provided. The apparatus includes:

a determining unit 710 configured to determine a reference block of acurrent block, where the reference block and the current block arespatially adjacent, and the reference block is predicted by using anaffine motion model;

an obtaining unit 720 configured to obtain location information andmotion information of at least two feature points in the referenceblock, where the at least two feature points are located in subblocks inwhich at least two control points in the reference block are located,the at least two control points are control points used in the affinemotion model used to predict the reference block, and motion informationof the subblock in which the feature point is located is obtained basedon motion information of the corresponding feature point;

a calculation unit 730 configured to calculate motion information ofeach subblock in the current block based on the location information andthe motion information of the at least two feature points in thereference block; and

a prediction unit 740 configured to perform motion compensationprediction on each subblock in the current block based on the motioninformation of each subblock in the current block, to obtain aprediction block of the current block.

In some embodiments, the feature point is in a central location of thesubblock in which the control point in the reference block is located.

In some embodiments, the location information of the feature point inthe reference block is obtained by offsetting location information ofthe control point in the reference block in the following manner:

(x′,y′)=(x+a,y+b), where (x,y) are coordinates of a control point in thereference block, (x′,y′) are coordinates of a feature point in asubblock in which the control point whose coordinates are (x,y) in thereference block is located, a is a horizontal offset, b is a verticaloffset, and a and b are not equal to 0.

In some embodiments, the at least two control points in the referenceblock include at least two of an upper left vertex, an upper rightvertex, a lower left vertex, and a lower right vertex of the referenceblock, and when location coordinates of the upper left vertex of thereference block are (x₀,y₀) a width of the reference block is w, and aheight of the reference block is h,

$\{ {\begin{matrix}{( {x_{1},y_{1}} ) = ( {{x_{0} + w},y_{0}} )} \\{( {x_{2},y_{2}} ) = ( {x_{0},{y_{0} + h}} )} \\{( {x_{3},y_{3}} ) = ( {{x_{0} + w},{y_{0} + h}} )}\end{matrix},} $

where (x₁,y₁) are coordinates of the upper right vertex of the referenceblock, (x₂,y₂) are coordinates of the lower left vertex of the referenceblock, and (x₃,y₃) are coordinates of the lower right vertex of thereference block.

In some embodiments, the at least two feature points include featurepoints whose coordinates are respectively (x₀′,y₀′) and (x₁′,y₁′) in thereference block, where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, and w is a width of the reference block.

In some embodiments, the at least two feature points include featurepoints whose coordinates are respectively (x₀′,y₀′), (x₁′,y₁′), and(x₂′,y₂′) in the reference block, where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, (x₂,y₂) are coordinates of a control pointin a subblock in which the feature point (x₂′,y₂′) in the referenceblock is located, w is a width of the reference block, and h is a heightof the reference block.

In some embodiments, the at least two feature points include featurepoints whose coordinates are respectively (x₀′,y₀′), (x₁′,y₁′),(x₂′,y₂′), and (x₃′,y₃′) in the reference block, where

$\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{3} - {N_{1}/2}},{y_{3} - {N_{2}/2}}} )}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} } $

where N₁ is a width of the subblock in which the control point in thereference block is located, N₂ is a height of the subblock in which thecontrol point in the reference block is located, (x₀,y₀) are coordinatesof a control point in a subblock in which the feature point (x₀′,y₀′) inthe reference block is located, (x₁,y₁) are coordinates of a controlpoint in a subblock in which the feature point (x₁′,y₁′) in thereference block is located, (x₂,y₂) are coordinates of a control pointin a subblock in which the feature point (x₂′,y₂′) in the referenceblock is located, (x₃,y₃) are coordinates of a control point in asubblock in which the feature point (x₃′,y₃′) in the reference block islocated, w is a width of the reference block, and h is a height of thereference block.

In some embodiments, the calculation unit is configured to calculate themotion information of each subblock in the current block based on thelocation information and the motion information of the at least twofeature points in the reference block and location information of eachsubblock in the current block.

In some embodiments, the calculation unit is configured to calculate themotion information of each subblock in the current block with referenceto the following formula and based on the location information and themotion information of the at least two feature points in the referenceblock and the location information of each subblock in the currentblock:

$\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},}  & \;\end{matrix}$

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) and (x₁′,y₁′) in the reference block;

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in thereference block, where

vx₀ is a horizontal motion vector of the feature point (x₀′,y₀′), vy₀ isa vertical motion vector of the feature point (x₀′,y₀′); vx₁ is ahorizontal motion vector of the feature point (x₁′,y₁′), vy₁ is avertical motion vector of the feature point (x₁′,y₁′), vy₂ is a verticalmotion vector of the feature point (x₂′,y₂′), vx₂ is a horizontal motionvector of the feature point (x₂′,y₂′), vy₃ is a vertical motion vectorof the feature point (x₃′,y₃′), and vx₃ is a horizontal motion vector ofthe feature point (x₃′,y₃′); and

vx is a horizontal motion vector of a subblock whose coordinates are(x,y) in the current block, and vy is a vertical motion vector of thesubblock whose coordinates are (x,y) in the current block.

In some embodiments, the calculation unit is configured to: calculate,based on the location information and the motion information of the atleast two feature points in the reference block, motion information ofat least two control points used in an affine motion model used for thecurrent block; and calculate the motion information of each subblock inthe current block based on location information of each subblock in thecurrent block and the motion information and location information of theat least two control points used in the affine motion model used for thecurrent block.

In some embodiments, when calculating, based on the location informationand the motion information of the at least two feature points in thereference block, the motion information of the at least two controlpoints used in the affine motion model used for the current block, thecalculation unit is configured to calculate, with reference to thefollowing formula and based on the location information and the motioninformation of the at least two feature points in the reference block,the motion information of the at least two control points used in theaffine motion model used for the current block:

$\{ {\begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\mspace{14mu}{or}\{ {\begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}\{ {\begin{matrix}{{vx}_{7} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{7} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},} } } } } } } } } $

where the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′) and (x₁′,y₁′) in the reference block;

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or

the at least two feature points include the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in thereference block, where

the at least two control points used in the affine motion model used forthe current block include control points whose coordinates arerespectively (x₄,y₄) and (x₅,y₅) in the current block; the at least twocontrol points used in the affine motion model used for the currentblock include control points whose coordinates are respectively (x₄,y₄),(x₅,y₅), and (x₆,y₆) in the current block; or the at least two controlpoints used in the affine motion model used for the current blockinclude control points whose coordinates are respectively (x₄,y₄),(x₅,y₅), (x₆,y₆), and (x₇,y₇) in the current block; and

vx₄ is a horizontal motion vector of the control point (x₄,y₄), vy₄ is avertical motion vector of the control point (x₄,y₄); vx₅ is a horizontalmotion vector of the control point (x₅,y₅) vy₅ is a vertical motionvector of the control point (x₅,y₅), vx₆ is a horizontal motion vectorof the control point (x₆,y₆), vy₆ is a vertical motion vector of thecontrol point (x₆,y₆), vx₇ is a horizontal motion vector of the controlpoint (x₇,y₇), and vy₇ is a vertical motion vector of the control point(x₇,y₇).

In some embodiments, when calculating the motion information of eachsubblock in the current block based on the location information of eachsubblock in the current block and the motion information and thelocation information of the at least two control points used in theaffine motion model used for the current block, the calculation unit isconfigured to calculate the motion information of each subblock in thecurrent block with reference to the following formula and based on thelocation information of each subblock in the current block and themotion information and the location information of the at least twocontrol points used in the affine motion model used for the currentblock:

$\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} - {\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}{\mspace{11mu}\;}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vx}_{7} + {vx}_{4}} ) - ( {{vx}_{5} + {vx}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vy}_{7} + {vy}_{4}} ) - ( {{vy}_{5} + {vy}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix},}  & \;\end{matrix}$

where vx is a horizontal motion vector of a subblock whose coordinatesare (x,y) in the current block, and vy is a vertical motion vector ofthe subblock whose coordinates are (x,y) in the current block.

The picture prediction apparatus 700 may be applied to a video codingapparatus or a video decoding apparatus.

Referring to FIG. 8, in one embodiment, a picture prediction apparatus800 is provided. The apparatus 800 may include: a storage component 810and a processor 830 coupled to the storage component. The storagecomponent 810 is configured to store an instruction, and the processor830 is configured to execute the instruction. When executing theinstruction, the processor 830 may perform, according to theinstruction, steps performed by the picture prediction apparatus in anymethod in the foregoing embodiments of this application.

The processor 830 may also be referred to as a central processing unit(CPU). The storage component 810 may include a read-only memory and arandom access memory, and provide an instruction and data to theprocessor 830. A part of the storage component 810 may further include anon-volatile random access memory. In one embodiment, components of thepicture prediction apparatus 800 are coupled by using, for example, abus system. The bus system may further include a power bus, a controlbus, a status signal bus, and the like, in addition to a data bus.However, for clear description, various types of buses in the figure aremarked as the bus system 840. The methods disclosed in the foregoingembodiments may be applied to the processor 830, or are implemented bythe processor 830. The processor 830 may be an integrated circuit chipand has a signal processing capability.

In one embodiment, steps in the foregoing methods can be implemented byusing a hardware integrated logical circuit in the processor 830, or byusing instructions in a form of software. The processor 830 may be ageneral purpose processor, a digital signal processor, anapplication-specific integrated circuit, a field programmable gate arrayor another programmable logic device, a discrete gate or a transistorlogic device, or a discrete hardware component. The processor 830 mayimplement or execute methods, steps and logical block diagrams in themethod embodiments of the present disclosure. The general purposeprocessor may be a microprocessor, or the processor may be anyconventional processor or the like. Steps of the methods disclosed withreference to the embodiments of the present disclosure may be directlyperformed and accomplished by means of a hardware decoding processor, ormay be executed and accomplished by using a combination of hardware andsoftware modules in the decoding processor. A software module may belocated in a mature storage medium in the art, such as a random accessmemory, a flash memory, a read-only memory, a programmable read-onlymemory, an electrically erasable programmable memory, a register, or thelike. The storage medium is located in the storage component 810, forexample the processor 830 reads information in the storage component 810and completes the steps in the foregoing methods in combination withhardware of the processor.

For example, the picture prediction apparatus 800 may perform the stepsin the methods corresponding to the embodiments shown in FIG. 2 to FIG.6.

The picture prediction apparatus provided in this embodiment of thisapplication is applied to a video coding apparatus or a video decodingapparatus. The video coding apparatus or the video decoding apparatusmay be any apparatus that needs to output or store a video, for example,a device such as a notebook computer, a tablet computer, a personalcomputer, a mobile phone, or a video server.

In addition, an embodiment of this application further provides acomputer-readable storage medium. The computer-readable storage mediumstores program code. The program code includes an instruction used toperform some or all steps in any picture prediction method according tothe embodiments of the present disclosure.

An embodiment of this application further provides a computer programproduct. When the computer program product runs on a computer, thecomputer is enabled to perform some or all steps in the methods in theforegoing method embodiments.

An embodiment of this application further provides an applicationrelease platform. The application release platform is used to release acomputer program product, and when the computer program product runs ona computer, the computer is enabled to perform some or all steps in themethods in the foregoing method embodiments.

FIG. 9-A is a schematic block diagram of a video encoder 20 to which anembodiment of this application may be applied. The video encoder 20includes an encoder side prediction module 201, a transformation andquantization module 202, an entropy encoding module 203, an encodingreconstruction module 204, and an encoder side filtering module 205.FIG. 9-B is a schematic block diagram of a video decoder 30 to which anembodiment of this application may be applied. The video decoder 30includes a decoder side prediction module 206, an inverse-transformationand dequantization module 207, an entropy decoding module 208, adecoding reconstruction module 209, and a decoder side filtering module210.

The video encoder 20 may be configured to perform the picture predictionmethod or a video coding method in the embodiments of this application.The video encoder 30 may be configured to perform the picture predictionmethod or a video decoding method in the embodiments of thisapplication. Details are as follows:

The encoder side prediction module 201 and the decoder side predictionmodule 206 are configured to generate prediction data. The video encoder20 may generate CUs that can no longer be divided and that include oneor more prediction units (PUs). Each PU of the CU may be associated withdifferent pixel blocks in a pixel block of the CU. The video encoder 20may generate a predictive pixel block for each PU of the CU. The videoencoder 20 may generate the predictive pixel block of the PU by means ofintra-frame prediction or inter-frame prediction. If the video encoder20 generates the predictive pixel block of the PU by means ofintra-frame prediction, the video encoder 20 may generate the predictivepixel block of the PU based on a decoded pixel of a picture associatedwith the PU. If the video encoder 20 generates the predictive pixelblock of the PU by means of inter-frame prediction, the video encoder 20may generate the predictive pixel block of the PU based on a decodedpixel of one or more pictures different from a picture associated withthe PU. The video encoder 20 may generate a residual pixel block of theCU based on the predictive pixel block of the PU of the CU. The residualpixel block of the CU may indicate a difference between a sample valuein the predictive pixel block of the PU of the CU and a correspondingsample value in an initial pixel block of the CU.

The transformation and quantization module 202 is configured to processresidual data obtained through prediction. The video encoder 20 mayperform recursive quadtree partitioning on the residual pixel block ofthe CU, to partition the residual pixel block of the CU into one or moresmaller residual pixel blocks associated with a transform unit (TU) ofthe CU. Each pixel in a pixel block associated with the TU correspondsto one luminance sample and two chrominance samples. Therefore, each TUmay be associated with one luminance residual sample block and twochrominance residual sample blocks. The video encoder 20 may apply oneor more transformations to a residual sample block associated with theTU to generate a coefficient block (that is, a block of a coefficient).The transformation may be a DCT transformation or a variant thereof. Atwo-dimensional transformation is calculated by using a DCTtransformation matrix and by applying a one-dimensional transformationin horizontal and vertical directions, to obtain the coefficient block.The video encoder 20 may perform a quantization procedure on eachcoefficient in the coefficient block. Quantization usually refers to aprocess in which a coefficient is quantized to reduce a data volume usedto indicate the coefficient, for further compression. Theinverse-transformation and dequantization module 207 performs an inverseprocess of the transformation and quantization module 202.

The video encoder 20 may generate a set of syntactic elements indicatingthe coefficient in the coefficient block after the quantization. Thevideo encoder 20 may apply, by using the entropy encoding module 203, anentropy encoding operation (for example, a context-adaptive binaryarithmetic coding (CABAC) operation) to some or all of the foregoingsyntactic elements. To apply CABAC coding to the syntactic elements, thevideo encoder 20 may binarize the syntactic elements to form a binarysequence including one or more bits (referred to as “binary bits”). Thevideo encoder 20 may encode some of the binary bits by means of regular(regular) encoding, and may encode other binary bits by means of bypassencoding.

In addition to performing entropy encoding on the syntactic elements ofthe coefficient block, the video encoder 20 may apply, by using theencoding reconstruction module 204, inverse quantization and an inversetransformation to a transformed coefficient block, to reconstruct aresidual sample block by using the transformed coefficient block. Thevideo encoder 20 may add the reconstructed residual sample block to asample block corresponding to one or more predictive sample blocks, togenerate a reconstructed sample block. By reconstructing a sample blockof each color component, the video encoder 20 may reconstruct the pixelblock associated with the TU. A pixel block of each TU of the CU isreconstructed in such a manner until an entire pixel block of the CU isreconstructed.

After reconstructing the pixel block of the CU, the video encoder 20performs a deblocking filtering operation by using the encoder sidefiltering module 205, to reduce a block effect of the pixel blockassociated with the CU. After performing the deblocking filteringoperation, the video encoder 20 may use a sample adaptive offset (SAO)to modify a reconstructed pixel block of the CTB of the picture. Afterperforming these operations, the video encoder 20 may store thereconstructed pixel block of the CU in a decoded picture buffer forgenerating a predictive pixel block of another CU.

The video decoder 30 may receive a bitstream. The bitstream includes, inthe form of a bit stream, encoding information of video data encoded bythe video encoder 20. The video decoder 30 parses the bitstream by usingthe entropy decoding module 208 to extract a syntactic element from thebitstream. When performing CABAC decoding, the video decoder 30 mayperform regular decoding on some binary bits and may perform bypassdecoding on other binary bits. Binary bits in the bitstream have amapping relationship with the syntactic element, and the syntacticelement is obtained by parsing the binary bits.

The video decoder 30 may reconstruct a picture of the video data basedon the syntactic element extracted from the bitstream and by using thedecoding reconstruction module 209. A process of reconstructing thevideo data based on the syntactic element is basically inverse to aprocess performed by the video encoder 20 to generate the syntacticelement. For example, the video decoder 30 may generate, based on asyntactic element associated with a CU, a predictive pixel block of a PUof the CU. In addition, the video decoder 30 may perform inversequantization on a coefficient block associated with a TU of the CU. Thevideo decoder 30 may perform an inverse transformation on thecoefficient block on which the inverse quantization has been performed,to reconstruct a residual pixel block associated with the TU of the CU.The video decoder 30 may reconstruct a pixel block of the CU based onthe predictive pixel block and the residual pixel block.

After reconstructing the pixel block of the CU, the video decoder 30performs a deblocking filtering operation by using the decodingfiltering module 210, to reduce a block effect of the pixel blockassociated with the CU. In addition, the video decoder 30 may perform,based on one or more SAO syntactic elements, a same SAO operation asthat of the video encoder 20. After performing these operations, thevideo decoder 30 may store the pixel block of the CU in the decodedpicture buffer. The decoded picture buffer may provide a referencepicture used for subsequent motion compensation, intra-frame prediction,and presentation by a display apparatus. FIG. 10 and FIG. 11 are twoschematic block diagrams of an electronic apparatus 50, where theelectronic apparatus 50 may be integrated to a codec to which thisembodiment of this application may be applied. FIG. 11 is a schematicdiagram for video coding apparatus according to an embodiment of thisapplication. The following describes the units in FIG. 10 and FIG. 11.

The electronic apparatus 50 may be, for example, a mobile terminal oruser equipment in a wireless communications system. It should beunderstood that the embodiments of this application may be implementedin any electronic device or apparatus that may need to code and decode,or code, or decode a video picture.

The apparatus 50 may include a housing 30 configured to accommodate andprotect a device. The apparatus 50 may further include a display 32 in aform of a liquid crystal display. In another embodiment of thisapplication, the display may be any proper display technology suitablefor displaying a picture or a video. The apparatus 50 may furtherinclude a keypad 34. In another embodiment of this application, anyproper data or user interface mechanism may be applied. For example, auser interface may be implemented as a virtual keyboard or a datarecording system to serve as a part of a touch sensitive display. Theapparatus may include a microphone 36 or any proper audio input, and theaudio input may be digital or analog signal input. The apparatus 50 mayfurther include the following audio output device, and the audio outputdevice may be any one of the following items in the embodiments of thisapplication: a headset 38, a speaker, or an analog audio or digitalaudio output connection. The apparatus 50 may also include a battery 40.In another embodiment of this application, the device may be powered byany proper mobile energy device, for example, a solar power battery, afuel battery, or a clock mechanism generator. The apparatus may furtherinclude an infrared port 42 configured to perform short-distanceline-of-sight communication with another device. In another embodiment,the apparatus 50 may further include any proper solution forshort-distance communication, for example, a Bluetooth wirelessconnection or a USB/live line wired connection.

The apparatus 50 may include a controller 56 or a processor configuredto control the apparatus 50. The controller 56 may be connected to amemory 58. In the embodiments of this application, the memory may storedata in a form of a picture and audio data, and/or may store aninstruction for execution on the controller 56. The controller 56 may befurther connected to a codec circuit 54 suitable for encoding anddecoding audio and/or video data or assisting encoding and decodingimplemented by the controller 56.

The apparatus 50 may further include a card reader 48 and a smart card46, for example, a UICC and a UICC reader, that are configured toprovide user information and that are suitable for providingauthentication information for network authentication and userauthorization.

The apparatus 50 may further include a radio interface circuit 52. Theradio interface circuit is connected to a controller and is suitable forgenerating, for example, a wireless communication signal used tocommunicate with a cellular communication network, a wirelesscommunications system, or a wireless local area network. The apparatus50 may further include an antenna 44. The antenna is connected to theradio interface circuit 52, and is configured to: send a radio frequencysignal generated by the radio interface circuit 52 to another (aplurality of) apparatus and receive a radio frequency signal fromanother (a plurality of) apparatus.

In some embodiments, the apparatus 50 includes a camera that can recordor detect single frames. The codec circuit 54 or a controller receivesand processes the single frames. In some embodiments, the apparatus mayreceive to-be-processed video picture data from another device beforetransmission and/or storage. In some embodiments, the apparatus 50 mayreceive, through a wireless or wired connection, a picture forencoding/decoding.

The solution in this embodiment of this application may be applied tovarious electronic apparatuses. For example, the following providesexamples in which this embodiment of this application is applied to atelevision device and a mobile phone device.

FIG. 12 is a schematic structural diagram of a television application towhich an embodiment of this application is applied.

The television device 900 includes an antenna 901, a tuner 902, amultichannel demultiplexer 903, a decoder 904, a video signal processor905, a display unit 906, an audio signal processor 907, a speaker 908,an external interface 909, a controller 910, a user interface 911, a bus912, and the like.

The tuner 902 extracts a signal of a desired channel from a broadcastsignal received by the antenna 901, and demodulates the extractedsignal. The tuner 902 subsequently outputs an encoded bitstream obtainedthrough demodulation to the multichannel demultiplexer 903. That is, thetuner 902 is used as a sending apparatus in the television device 900receiving an encoded bitstream of an encoded picture.

The multichannel demultiplexer 903 separates a video stream from anaudio stream of a to-be-viewed program in the encoded bitstream, andoutputs the separated streams to the decoder 904. The multichanneldemultiplexer 903 further extracts auxiliary data from the encodedbitstream, for example, an electronic program guide, and provides theextracted data to the controller 910. If the encoded bitstream isscrambled, the multichannel demultiplexer 903 may descramble the encodedbitstream.

The decoder 904 decodes the video stream and the audio stream inputtedfrom the multichannel demultiplexer 903. The decoder 904 subsequentlyoutputs video data generated through decoding to the video signalprocessor 905. The decoder 904 further outputs audio data generatedthrough decoding to the audio signal processor 907.

The video signal processor 905 reproduces video data inputted from thedecoder 904, and displays the video data on the display unit 906. Thevideo signal processor 905 may further display, on the display unit 906,an application picture provided through a network. In addition, thevideo signal processor 905 may perform additional processing, forexample, noise removing, on the video data based on settings. The videosignal processor 905 may further generate a GUI (graphical userinterface) picture and superimpose the generated picture on an outputtedpicture.

The display unit 906 is driven by a drive signal provided by the videosignal processor 905, and displays a video or a picture on a videoscreen of a display apparatus, for example, a liquid crystal display, aplasma display, or an organic light-emitting diode (OLED).

The audio signal processor 907 performs reproduction processing, forexample, digital-to-analog conversion and amplification, on audio datainputted from the decoder 904, and outputs audio by using the speaker908. In addition, the audio signal processor 907 may perform additionalprocessing, for example, noise removing, on the audio data.

The external interface 909 is an interface configured to connect thetelevision device 900 to an external apparatus or a network. Forexample, a video stream or an audio stream received by the externalinterface 909 may be decoded by the decoder 904. That is, the externalinterface 909 is also used as a sending apparatus in the televisiondevice 900 receiving an encoded bitstream of an encoded picture.

The controller 910 includes a processor and a memory. The memory storesa program to be executed by the processor, program data, auxiliary data,data obtained through a network, and the like. For example, when thetelevision device 900 is started, the program stored in the memory isread and executed by the processor. The processor controls an operationof the television device 900 based on a control signal inputted from theuser interface 911.

The user interface 911 is connected to the controller 910. For example,the user interface 911 includes a button and a switch enabling the userto operate the television device 900 and a receiving unit configured toreceive a remote control signal. The user interface 911 detects anoperation performed by a user through these components, generates acontrol signal, and outputs the generated control signal to thecontroller 910.

The bus 912 connects the tuner 902, the multichannel demultiplexer 903,the decoder 904, the video signal processor 905, the audio signalprocessor 907, the external interface 909, and the controller 910 toeach other.

In the television device 900 having this structure, the decoder 904 mayhave the functions of the video decoding apparatus or the pictureprediction apparatus according to the foregoing embodiments. Forexample, the decoder 904 may be configured to: determine a referenceblock of a current block, where the reference block and the currentblock are spatially adjacent, and the reference block is predicted byusing an affine motion model; obtain location information and motioninformation of at least two feature points in the reference block, wherethe at least two feature points are located in subblocks in which atleast two control points in the reference block are located, the atleast two control points are control points used in the affine motionmodel used for the reference block, and motion information of thesubblock in which the feature point is located is obtained based on themotion information of the corresponding feature point; calculatingmotion information of each subblock in the current block based on thelocation information and the motion information of the at least twofeature points in the reference block; and performing motioncompensation prediction on each subblock in the current block based onthe motion information of each subblock in the current block, to obtaina prediction block of the current block.

FIG. 13 is a schematic structural diagram of a mobile phone applicationto which an embodiment of this application is applied. The mobile phoneapparatus 920 may include an antenna 921, a communications unit 922, anaudio codec 923, a speaker 924, a microphone 925, a camera unit 926, apicture processor 927, a multichannel demultiplexer 928, arecording/reproduction unit 929, a display unit 930, a controller 931,an operation unit 932, a bus 933, and the like.

The antenna 921 is connected to the communications unit 922. The speaker924 and the microphone 925 are connected to the audio codec 923. Theoperation unit 932 is connected to the controller 931. The bus 933connects the communications unit 922, the audio codec 923, the cameraunit 926, the picture processor 927, the multichannel demultiplexer 928,the recording/reproduction unit 929, the display unit 930, and thecontroller 931 to each other.

The mobile phone apparatus 920 performs an operation, for example, audiosignal sending/receiving, email and picture data sending/receiving,picture shooting, and data recording, in various operation modes. Thevarious operation modes include an audio call mode, a data communicationmode, an imaging mode, and a video call mode.

In the audio call mode, an analog audio signal generated by themicrophone 925 is provided to the audio codec 923. The audio codec 923converts the analog audio signal to audio data, performs analog todigital conversion on the converted audio data, and compresses the audiodata. The audio codec 923 subsequently outputs the audio data obtainedas a compression result to the communications unit 922. Thecommunications unit 922 encodes and demodulates the audio data togenerate a to-be-sent signal. The communications unit 922 subsequentlysends the generated to-be-sent signal to a base station by using theantenna 921. The communications unit 922 further amplifies a wirelesselectrical signal received by the antenna 921 and performs frequencyconversion on the wireless electrical signal received by the antenna921, to obtain the received signal. The communications unit 922subsequently demodulates and decodes the received signal, to generateaudio data, and outputs the generated audio data to the audio codec 923.The audio codec 923 decompresses the audio data and performsdigital-to-analog conversion on the audio data to generate an analogaudio signal. The audio codec 923 subsequently provides the generatedaudio signal to the speaker 924 to output audio from the speaker 924.

In the data communication mode, for example, the controller 931generates, based on an operation performed by a user by using theoperation unit 932, text data to be included in an email. The controller931 further displays text on the display unit 930. The controller 931further generates email data in response to a sending instructionentered by a user by using the operation unit 932, and outputs thegenerated email data to the communications unit 922. The communicationsunit 922 encodes and demodulates the email data to generate a to-be-sentsignal. The communications unit 922 subsequently sends the generatedto-be-sent signal to a base station by using the antenna 921. Thecommunications unit 922 further amplifies a wireless electrical signalreceived by the antenna 921 and performs frequency conversion on thewireless electrical signal received by the antenna 921, to obtain areceived signal. The communications unit 922 subsequently demodulatesand decodes the received signal to recover the email data, and outputsthe recovered email data to the controller 931. The controller 931displays email content on the display unit 930, and stores the emaildata in a storage medium of the recording/reproduction unit 929.

The recording/reproduction unit 929 includes a readable/writable storagemedium. For example, the storage medium may be an internal storagemedium, or may be a storage medium mounted outside, for example, a harddisk, a magnetic disk, a magnetic optical disc, a universal serial bus(USB) storage, or a memory card.

In the imaging mode, the camera unit 926 pictures an object to generatepicture data, and outputs the generated picture data to the pictureprocessor 927. The picture processor 927 encodes the picture datainputted from the camera unit 926, and stores an encoded bitstream in astorage medium of the storage/reproduction unit 929.

In the video call mode, the multichannel demultiplexer 928 performsmultichannel multiplexing on a video stream encoded by the pictureprocessor 927 and an audio stream inputted from the audio codec 923, andoutputs a plurality of multiplexed streams to the communications unit922. The communications unit 922 encodes and modulates the plurality ofmultiplexed streams to generate a to-be-sent signal. The communicationsunit 922 subsequently sends the generated to-be-sent signal to a basestation by using the antenna 921. The communications unit 922 furtheramplifies a wireless electrical signal received by the antenna 921 andperforms frequency conversion on the wireless electrical signal receivedby the antenna 921, to obtain a received signal. The to-be-sent signaland the received signal may include an encoded bitstream. Thecommunications unit 922 subsequently demodulates and decodes thereceived signal to recover a stream, and outputs the recovered stream tothe multichannel demultiplexer 928. The multichannel demultiplexer 928separates a video stream from an audio stream in an inputted stream, andoutputs the video stream to the picture processor 927 and outputs theaudio stream to the audio codec 923. The picture processor 927 decodesthe video stream to generate video data. The video data is provided tothe display unit 930, and a series of pictures are displayed on thedisplay unit 930. The audio codec 923 decompresses the audio stream andperforms digital-to-analog conversion on the audio stream to generate ananalog audio signal. The audio codec 923 subsequently provides thegenerated audio signal to the speaker 924, so that the speaker 924outputs audio.

In the mobile phone apparatus 920 having this structure, the pictureprocessor 927 has the functions of the video coding apparatus (the videoencoder and the picture prediction apparatus) and/or the video decodingapparatus (the video decoder) in the foregoing embodiments.

For example, the picture processor 927 may be configured to: determine areference block of a current block, where the reference block and thecurrent block are spatially adjacent, and the reference block ispredicted by using an affine motion model; obtain location informationand motion information of at least two feature points in the referenceblock, where the at least two feature points are located in subblocks inwhich at least two control points in the reference block are located,the at least two control points are control points used in the affinemotion model used for the reference block, and motion information of thesubblock in which the feature point is located is obtained based on themotion information of the corresponding feature point; and calculatemotion information of each subblock in the current block based on thelocation information and the motion information of the at least twofeature points in the reference block; and perform motion compensationprediction on each subblock in the current block based on the motioninformation of each subblock in the current block, to obtain aprediction block of the current block.

In the foregoing embodiments, the description of each embodiment hasrespective focuses. For a part that is not described in detail in anembodiment, reference may be made to related descriptions in otherembodiments.

It should be understood that “one embodiment” or “an embodiment”mentioned in the whole specification does not mean that particularfeatures, structures, or characteristics related to this embodiment areincluded in at least one embodiment of this application. Therefore, “inone embodiment” or “in an embodiment” appearing throughout thespecification does not refer to a same embodiment. In addition, theseparticular features, structures, or characteristics may be combined inone or more embodiments by using any appropriate manner. A personskilled in the art should also appreciate that all the embodimentsdescribed in the specification are preferred embodiments, and therelated actions and modules are not necessarily mandatory to thisapplication.

It should be understood that certainty sequence numbers of the foregoingprocesses do not mean execution sequences in various embodiments of thisapplication. The execution sequences of the processes should bedetermined according to functions and internal logic of the processes,and should not be construed as any limitation on the implementationprocesses of the embodiments of this application.

In addition, the terms “system” and “network” may be usedinterchangeably in this specification. The term “and/or” in thisspecification describes only an association relationship for describingassociated objects and represents that three relationships may exist.For example, A and/or B may represent the following three cases: Only Aexists, both A and B exist, and only B exists. In addition, thecharacter “/” in this specification generally indicates an “or”relationship between the associated objects.

It should be understood that in the embodiments of this application, “Bcorresponding to A” indicates that B is associated with A, and B may bedetermined according to A. However, it should further be understood thatdetermining B according to A does not mean that B is determinedaccording to A only; that is, B may also be determined according to Aand/or other information.

All or some of the foregoing embodiments may be implemented by means ofsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, the embodiments may be implementedcompletely or partially in a form of a computer program product. Thecomputer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on thecomputer, the procedure or functions according to the embodiments ofthis application are all or partially generated. The computer may be ageneral-purpose computer, a dedicated computer, a computer network, orother programmable apparatuses. The computer instructions may be storedin a computer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (DSL)) or wireless (forexample, infrared, radio, or microwave) manner. The computer-readablestorage medium may be any usable medium accessible by a computer, or adata storage device, such as a server or a data center, integrating oneor more usable media. The usable medium may be a magnetic medium (forexample, the magnetic medium may be a soft disk, a hard disk, or amagnetic tape), an optical medium (for example, an optical disc)), asemiconductor medium (for example, a solid state disk), or the like. Inthe foregoing embodiments, the description of each embodiment hasrespective focuses. For a part that is not described in detail in anembodiment, reference may be made to related descriptions in otherembodiments.

In the several embodiments provided in this application, it should beunderstood that the disclosed apparatus may be implemented in othermanners. For example, the described apparatus embodiment is merely anexample. For example, the unit division is merely logical functiondivision and may be other division in actual implementation. Forexample, a plurality of units or components may be combined orintegrated into another system, or some features may be ignored or notperformed. In addition, the displayed or discussed mutual couplings ordirect couplings or communication connections may be implemented throughsome interfaces. The indirect couplings or communication connectionsbetween the apparatuses or units may be implemented in electronic orother forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected according toactual requirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software functional unit.

When the integrated unit is implemented in the form of a softwarefunctional unit and sold or used as an independent product, theintegrated unit may be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions of the presentdisclosure essentially, or the part contributing to the prior art, orall or some of the technical solutions may be implemented in the form ofa software product. The software product is stored in a storage mediumand includes several instructions for instructing a computer device(which may be a personal computer, a server, or a network device) toperform all or some of the steps of the methods described in theembodiments of the present disclosure. The foregoing storage mediumincludes: any medium that can store program code, such as a USB flashdrive, a read-only memory (ROM), a random access memory (RAM), aremovable hard disk, a magnetic disk, or an optical disc.

The foregoing embodiments are merely intended for describing thetechnical solutions of the present disclosure, but not for limiting thepresent disclosure. Although the present disclosure is described indetail with reference to the foregoing embodiments, persons of ordinaryskill in the art should understand that they may still makemodifications to the technical solutions described in the foregoingembodiments or make equivalent replacements to some technical featuresthereof, without departing from the scope of the technical solutions ofthe embodiments of the present disclosure.

What is claimed is:
 1. A method of picture prediction, comprising:determining a reference block of a current block, wherein the referenceblock and the current block are spatially adjacent, and the referenceblock is predicted by using an affine motion model; obtaining locationinformation and motion information of at least two feature points in thereference block, wherein the at least two feature points are located inat least two respective subblocks of the reference block in which atleast two control points in the reference block are located, the atleast two control points are used in the affine motion model used forreconstructing the reference block, and motion information of a subblockof the reference block in which a feature point is located is obtainedbased on motion information of a corresponding feature point;calculating motion information of each subblock in the current blockbased on the location information and the motion information of the atleast two feature points in the reference block; and performing motioncompensation prediction on each subblock in the current block based onthe motion information of each subblock in the current block, to obtaina prediction block of the current block; wherein calculating the motioninformation of each subblock in the current block comprises: calculatingthe motion information of each subblock in the current block based onthe location information and the motion information of the at least twofeature points in the reference block and location information of eachsubblock in the current block; wherein calculating the motioninformation of each subblock in the current block based on the locationinformation and the motion information of the at least two featurepoints in the reference block and the location information of eachsubblock in the current block comprises: calculating the motioninformation of each subblock in the current block with reference to thefollowing formula and based on the location information and the motioninformation of the at least two feature points in the reference blockand the location information of each subblock in the current block:$\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}\end{matrix},}  & \;\end{matrix}$ wherein the at least two feature points comprise thefeature points whose coordinates are (x₀′,y₀′) and (x₁′,y₁′) in thereference block; or the at least two feature points comprise at leasttwo of the feature points whose coordinates are (x₀′,y₀′), (x₁′,y₁′),and (x₂′,y₂′) in the reference block; or the at least two feature pointscomprise at least two of the feature points whose coordinates are(x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in the reference block,wherein vx₀ is a horizontal motion vector of the feature point(x₀′,y₀′), vy₀ is a vertical motion vector of the feature point(x₀′,y₀′); vx₁ is a horizontal motion vector of the feature point(x₁′,y₁′), vy₁ is a vertical motion vector of the feature point(x₁′,y₁′), vy₂ is a vertical motion vector of the feature point(x₂′,y₂′), vx₂ is a horizontal motion vector of the feature point(x₂′,y₂′), vy₃ is a vertical motion vector of the feature point(x₃′,y₃′), and vx₃ is a horizontal motion vector of the feature point(x₃′,y₃′); and vx is a horizontal motion vector of a subblock whosecoordinates are (x,y) in the current block, and vy is a vertical motionvector of the subblock whose coordinates are (x,y) in the current block.2. The method according to claim 1, wherein the feature point is in acentral location of the subblock in which the control point in thereference block is located.
 3. The method according to claim 1, whereinthe location information of the feature point in the reference block isobtained by offsetting location information of the control point in thereference block in the following manner: (x′,y′)=(x+a,y+b), (x,y) arecoordinates of a control point in the reference block, (x′,y′) arecoordinates of a feature point in a subblock in which the control pointwhose coordinates are (x,y) in the reference block is located, a is ahorizontal offset, b is a vertical offset, and a and b are not equal to0.
 4. The method according to claim 1, wherein the at least two controlpoints in the reference block comprise at least two of an upper leftvertex, an upper right vertex, a lower left vertex, and a lower rightvertex of the reference block, and when location coordinates of theupper left vertex of the reference block are (x₀,y₀), a width of thereference block is w, and a height of the reference block is h,$\quad\{ \begin{matrix}{( {x_{1},y_{1}} ) = ( {{x_{0} + w},y_{0}} )} \\{( {x_{2},y_{2}} ) = ( {x_{0},{y_{0} + h}} )} \\{( {x_{3},y_{3}} ) = ( {{x_{0} + w},{y_{0} + h}} )}\end{matrix} $ wherein (x₁,y₁) are coordinates of the upper rightvertex of the reference block, (x₂,y₂) are coordinates of the lower leftvertex of the reference block, and (x₃,y₃) are coordinates of the lowerright vertex of the reference block.
 5. The method according to claim 1,wherein the at least two feature points comprise feature points whosecoordinates are respectively (x₀′,y₀′) and (x₁′,y₁′) in the referenceblock, wherein $\begin{matrix}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )}\end{matrix},\;{or}}  & \; \\\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )}\end{matrix},}  & \;\end{matrix}$ wherein N₁ is a width of the subblock in which the controlpoint in the reference block is located, N₂ is a height of the subblockin which the control point in the reference block is located, (x₀,y₀)are coordinates of a control point in a subblock in which the featurepoint (x₀′,y₀′) in the reference block is located, (x₁,y₁) arecoordinates of a control point in a subblock in which the feature point(x₁′,y₁′) in the reference block is located, and w is the width of thereference block.
 6. The method according to claim 1, wherein the atleast two feature points comprise feature points whose coordinates arerespectively (x₀′,y₀′), (x₁′,y₁′) and (x₂′,y₂′) in the reference block,wherein $\begin{matrix}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )}\end{matrix},\;{or}}  \\\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} \end{matrix}$ wherein N₁ is a width of the subblock in which the controlpoint in the reference block is located, N₂ is a height of the subblockin which the control point in the reference block is located, (x₀,y₀)are coordinates of a control point in a subblock in which the featurepoint (x₀′,y₀′) in the reference block is located, (x₁,y₁) arecoordinates of a control point in a subblock in which the feature point(x₁′,y₁′) in the reference block is located, (x₂,y₂) are coordinates ofa control point in a subblock in which the feature point (x₂′,y₂′) inthe reference block is located, w is the width of the reference block,and h is the height of the reference block.
 7. The method according toclaim 1, wherein the at least two feature points comprise feature pointswhose coordinates are respectively (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and(x₃′,y₃′) in the reference block, wherein $\begin{matrix}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{3} - {N_{1}/2}},{y_{3} - {N_{2}/2}}} )}\end{matrix},\;{or}}  \\\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} \end{matrix}$ wherein N₁ is a width of the subblock in which the controlpoint in the reference block is located, N₂ is a height of the subblockin which the control point in the reference block is located, (x₀,y₀)are coordinates of a control point in a subblock in which the featurepoint (x₀′,y₀′) in the reference block is located, (x₁,y₁) arecoordinates of a control point in a subblock in which the feature point(x₁′,y₁′) in the reference block is located, (x₂,y₂) are coordinates ofa control point in a subblock in which the feature point (x₂′,y₂′) inthe reference block is located, (x₃,y₃) are coordinates of a controlpoint in a subblock in which the feature point (x₃′,y₃′) in thereference block is located, w is the width of the reference block, and his the height of the reference block.
 8. A method of picture prediction,comprising: determining a reference block of a current block, whereinthe reference block and the current block are spatially adjacent, andthe reference block is predicted by using an affine motion model;obtaining location information and motion information of at least twofeature points in the reference block, wherein the at least two featurepoints are located in at least two respective subblocks of the referenceblock in which at least two control points in the reference block arelocated, the at least two control points are used in the affine motionmodel used for reconstructing the reference block, and motioninformation of a subblock of the reference block in which a featurepoint is located is obtained based on motion information of acorresponding feature point; calculating motion information of eachsubblock in the current block based on the location information and themotion information of the at least two feature points in the referenceblock; and performing motion compensation prediction on each subblock inthe current block based on the motion information of each subblock inthe current block, to obtain a prediction block of the current block;wherein calculating the motion information of each subblock in thecurrent block comprises: calculating, based on the location informationand the motion information of the at least two feature points in thereference block, motion information of at least two control points usedin an affine motion model used for the current block; and calculatingthe motion information of each subblock in the current block based onlocation information of each subblock in the current block and themotion information and location information of the at least two controlpoints used in the affine motion model used for the current block;wherein calculating the motion information of the at least two controlpoints used in the affine motion model used for the current blockcomprises: calculating, with reference to the following formula andbased on the location information and the motion information of the atleast two feature points in the reference block, the motion informationof the at least two control points used in the affine motion model usedfor the current block: $\begin{matrix}\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ \begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \mspace{11mu} \\\{ \begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ \begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{7} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{7} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},}  & \;\end{matrix}$ wherein the at least two feature points comprise thefeature points whose coordinates are) (x₀′,y₀′) and (x₁′,y₁′) in thereference block; or the at least two feature points comprise at leasttwo of the feature points whose coordinates are (x₀′,y₀′), (x₁′,y₁′),(x₂′,y₂′), and (x₃′,y₃′) in the reference block, wherein the at leasttwo feature points comprise at least two of the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or the at least two control points used in the affine motionmodel used for the current block comprise control points whosecoordinates are respectively (x₄,y₄) and (x₅,y₅) in the current block;the at least two control points used in the affine motion model used forthe current block comprise at least two of control points whosecoordinates are respectively (x₄,y₄), and (x₆,y₆) in the current block;or the at least two control points used in the affine motion model usedfor the current block comprise at least two of control points whosecoordinates are respectively (x₄,y₄), (x₅,y₅), (x₆, y₆), and (x₇,y₇) inthe current block; and vx₄ is a horizontal motion vector of the controlpoint (x₄,y₄), vy₄ is a vertical motion vector of the control point(x₄,y₄); vx₅ is a horizontal motion vector of the control point (x₅,y₅),vy₅ is a vertical motion vector of the control point (x₅,y₅), vx₆ is ahorizontal motion vector of the control point (x₆,y₆), vy₆ is a verticalmotion vector of the control point (x₆,y₆), vx₇ is a horizontal motionvector of the control point (x₇,y₇), and vy₇ is a vertical motion vectorof the control point (x₇,y₇).
 9. The method according to claim 8,wherein calculating the motion information of each subblock in thecurrent block based on location information of each subblock in thecurrent block and the motion information and location information of theat least two control points used in the affine motion model used for thecurrent block comprises: calculating the motion information of eachsubblock in the current block with reference to the following formulaand based on the location information of each subblock in the currentblock and the motion information and the location information of the atleast two control points used in the affine motion model used for thecurrent block: $\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} - {\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}\mspace{14mu}{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vx}_{7} + {vx}_{4}} ) - ( {{vx}_{5} + {vx}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vy}_{7} + {vy}_{4}} ) - ( {{vy}_{5} + {vy}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix},}  & \;\end{matrix}$ wherein vx is a horizontal motion vector of a subblockwhose coordinates are (x,y) in the current block, and vy is a verticalmotion vector of the subblock whose coordinates are (x,y) in the currentblock.
 10. The method according to claim 1, wherein the method isapplied to a video coding process or a video decoding process.
 11. Anapparatus for picture prediction, comprising: one or more processors;and a memory coupled to the one or more processors to storeinstructions, which when executed by the one or more processors, causethe one or more processors to: determine a reference block of a currentblock, wherein the reference block and the current block are spatiallyadjacent, and the reference block is predicted by using an affine motionmodel; obtain location information and motion information of at leasttwo feature points in the reference block, wherein the at least twofeature points are located in at least two respective subblocks of thereference block in which at least two control points in the referenceblock are located, the at least two control points are control pointsused in the affine motion model used for the reference block, and motioninformation of a subblock of the reference block in which a featurepoint is located is obtained based on motion information of acorresponding feature point; calculate motion information of eachsubblock in the current block based on the location information and themotion information of the at least two feature points in the referenceblock; and perform motion compensation prediction on each subblock inthe current block based on the motion information of each subblock inthe current block, to obtain a prediction block of the current block;wherein to calculate the motion information of each subblock in thecurrent block, the instructions, which when executed by the one or moreprocessors, cause the one or more processors to calculate the motioninformation of each subblock in the current block based on the locationinformation and the motion information of the at least two featurepoints in the reference block and location information of each subblockin the current block; wherein to calculate the motion information ofeach subblock in the current block based on the location information andthe motion information of the at least two feature points in thereference block and the location information of each subblock in thecurrent block, the instructions, which when executed by the one or moreprocessors, cause the one or more processors to calculate the motioninformation of each subblock in the current block with reference to thefollowing formula and based on the location information and the motioninformation of the at least two feature points in the reference blockand the location information of each subblock in the current block:$\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},}  & \;\end{matrix}$ wherein the at least two feature points comprise thefeature points whose coordinates are (x₀′,y₀′) and (x₁′,y₁′) in thereference block; or the at least two feature points comprise at leasttwo of the feature points whose coordinates are (x₀′,y₀′), (x₁′,y₁′),and (x₂′,y₂′) in the reference block; or the at least two feature pointscomprise at least two of the feature points whose coordinates are(x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in the reference block,wherein vx₀ is a horizontal motion vector of the feature point(x₀′,y₀′), vy₀ is a vertical motion vector of the feature point(x₀′,y₀′); vx₁ is a horizontal motion vector of the feature point(x₁′,y₁′), vy₁ is a vertical motion vector of the feature point(x₁′,y₁′), vy₂ is a vertical motion vector of the feature point(x₂′,y₂′), vx₂ is a horizontal motion vector of the feature point(x₂′,y₂′), vy₃ is a vertical motion vector of the feature point(x₃′,y₃′), and vx₃ is a horizontal motion vector of the feature point(x₃′,y₃′); and vx is a horizontal motion vector of a subblock whosecoordinates are (x,y) in the current block, and vy is a vertical motionvector of the subblock whose coordinates are (x,y) in the current block.12. The apparatus according to claim 11, wherein the feature point is ina central location of the subblock in which the control point in thereference block is located.
 13. The apparatus according to claim 11,wherein the location information of the feature point in the referenceblock is obtained by offsetting location information of the controlpoint in the reference block in the following manner: (x′,y′)=(x+a,y+b),(x,y) are coordinates of a control point in the reference block, (x′,y′)are coordinates of a feature point in a subblock in which the controlpoint whose coordinates are (x,y) in the reference block is located, ais a horizontal offset, b is a vertical offset, and a and b are notequal to
 0. 14. The apparatus according to claim 11, wherein the atleast two control points in the reference block comprise at least two ofan upper left vertex, an upper right vertex, a lower left vertex, and alower right vertex of the reference block, and when location coordinatesof the upper left vertex of the reference block are (x₀,y₀), a width ofthe reference block is w, and a height of the reference block is h,$\{ {\begin{matrix}{( {x_{1},y_{1}} ) = ( {{x_{0} + w},y_{0}} )} \\{( {x_{2},y_{2}} ) = ( {x_{0},{y_{0} + h}} )} \\{( {x_{3},y_{3}} ) = ( {{x_{0} + w},{y_{0} + h}} )}\end{matrix},} $ wherein (x₁,y₁) are coordinates of the upperright vertex of the reference block, (x₂,y₂) are coordinates of thelower left vertex of the reference block, and (x₃,y₃) are coordinates ofthe lower right vertex of the reference block.
 15. The apparatusaccording to claim 11, wherein the at least two feature points comprisefeature points whose coordinates are respectively (x₀′,y₀′) and(x₁′,y₁′) in the reference block, wherein $\begin{matrix}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )}\end{matrix},\;{or}}  \\\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )}\end{matrix},} \end{matrix}$ wherein N₁ is a width of the subblock in which the controlpoint in the reference block is located, N₂ is a height of the subblockin which the control point in the reference block is located, (x₀,y₀)are coordinates of a control point in a subblock in which the featurepoint) (x₀′,y₀′) in the reference block is located, (x₁,y₁) arecoordinates of a control point in a subblock in which the feature point(x₁′,y₁′) in the reference block is located, and w is the width of thereference block.
 16. The apparatus according to claim 11, wherein the atleast two feature points comprise feature points whose coordinates arerespectively (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the reference block,wherein $\begin{matrix}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )}\end{matrix},\;{or}}  \\\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} \end{matrix}$ wherein N₁ is a width of the subblock in which the controlpoint in the reference block is located, N₂ is a height of the subblockin which the control point in the reference block is located, (x₀,y₀)are coordinates of a control point in a subblock in which the featurepoint (x₀′,y₀′) in the reference block is located, (x₁,y₁) arecoordinates of a control point in a subblock in which the feature point(x₁′,y₁′) in the reference block is located, (x₂,y₂) are coordinates ofa control point in a subblock in which the feature point (x₂′,y₂′) inthe reference block is located, w is the width of the reference block,and h is the height of the reference block.
 17. The apparatus accordingto claim 11, wherein the at least two feature points comprise featurepoints whose coordinates are respectively (x₀′,y₀′), (x₁′,y₁′),(x₂′,y₂′), and (x₃′,y₃′) in the reference block, wherein $\begin{matrix}\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{1} - {N_{1}/2}},{y_{1} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{2} + {N_{1}/2}},{y_{2} - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{3} - {N_{1}/2}},{y_{3} - {N_{2}/2}}} )}\end{matrix},\;{or}}  \\\{ {\begin{matrix}{( {x_{0}^{\prime},y_{0}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{1}^{\prime},y_{1}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + {N_{2}/2}}} )} \\{( {x_{2}^{\prime},y_{2}^{\prime}} ) = ( {{x_{0} + {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )} \\{( {x_{3}^{\prime},y_{3}^{\prime}} ) = ( {{x_{0} + w - {N_{1}/2}},{y_{0} + h - {N_{2}/2}}} )}\end{matrix},} \end{matrix}$ wherein N₁ is a width of the subblock in which the controlpoint in the reference block is located, N₂ is a height of the subblockin which the control point in the reference block is located, (x₀,y₀)are coordinates of a control point in a subblock in which the featurepoint (x₀′,y₀′) in the reference block is located, (x₁,y₁) arecoordinates of a control point in a subblock in which the feature point(x₁′,y₁′) in the reference block is located, (x₂,y₂) are coordinates ofa control point in a subblock in which the feature point (x₂′,y₂′) inthe reference block is located, (x₃,y₃) are coordinates of a controlpoint in a subblock in which the feature point (x₃′,y₃′) in thereference block is located, w is the width of the reference block, and his the height of the reference block.
 18. An apparatus for pictureprediction, comprising: one or more processors; and a memory coupled tothe one or more processors to store instructions, which when executed bythe one or more processors, cause the one or more processors to:determine a reference block of a current block, wherein the referenceblock and the current block are spatially adjacent, and the referenceblock is predicted by using an affine motion model; obtain locationinformation and motion information of at least two feature points in thereference block, wherein the at least two feature points are located inat least two respective subblocks of the reference block in which atleast two control points in the reference block are located, the atleast two control points are control points used in the affine motionmodel used for the reference block, and motion information of a subblockof the reference block in which a feature point is located is obtainedbased on motion information of a corresponding feature point; calculatemotion information of each subblock in the current block based on thelocation information and the motion information of the at least twofeature points in the reference block; and perform motion compensationprediction on each subblock in the current block based on the motioninformation of each subblock in the current block, to obtain aprediction block of the current block; wherein to calculate the motioninformation of each subblock in the current block, the instructions,which when executed by the one or more processors, cause the one or moreprocessors to: calculate, based on the location information and themotion information of the at least two feature points in the referenceblock, motion information of at least two control points used in anaffine motion model used for the current block; and calculate the motioninformation of each subblock in the current block based on locationinformation of each subblock in the current block and the motioninformation and location information of the at least two control pointsused in the affine motion model used for the current block; wherein tocalculate the motion information of the at least two control points usedin the affine motion model used for the current block, the instructions,which when executed by the one or more processors, cause the one or moreprocessors to calculate, with reference to the following formula andbased on the location information and the motion information of the atleast two feature points in the reference block, the motion informationof the at least two control points used in the affine motion model usedfor the current block: $\begin{matrix}\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} - {\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ \begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},{or}}  & \; \\\{ \begin{matrix}{{vx}_{4} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{4} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{4} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{4} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{4} - x_{0}^{\prime}} ) \times ( {y_{4} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \mspace{11mu} \\\{ \begin{matrix}{{vx}_{5} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{5} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{5} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{5} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{5} - x_{0}^{\prime}} ) \times ( {y_{5} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ \begin{matrix}{{vx}_{6} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{6} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{6} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{6} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{6} - x_{0}^{\prime}} ) \times ( {y_{6} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix}  & \; \\\{ {\begin{matrix}{{vx}_{7} = {{\frac{{vx}_{1} - {vx}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vx}_{2} - {vx}_{0}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vx}_{3} + {vx}_{0}} ) - ( {{vx}_{1} + {vx}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vx}_{0}}} \\{{vy}_{7} = {{\frac{{vy}_{1} - {vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x_{7} - x_{0}^{\prime}} )} + {\frac{{vy}_{2} - {vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y_{7} - y_{0}^{\prime}} )} + {\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{vy}_{1} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x_{7} - x_{0}^{\prime}} ) \times ( {y_{7} - y_{0}^{\prime}} )} + {vy}_{0}}}\end{matrix},}  & \;\end{matrix}$ wherein the at least two feature points comprise thefeature points whose coordinates are (x₀′,y₀′) and (x₁′,y₁′) in thereference block; or the at least two feature points comprise at leasttwo of the feature points whose coordinates are (x₀′,y₀′), (x₁′,y₁′),and (x₂′,y₂′) in the reference block; or the at least two feature pointscomprise at least two of the feature points whose coordinates are(x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′), and (x₃′,y₃′) in the reference block,wherein the at least two control points used in the affine motion modelused for the current block comprise control points whose coordinates arerespectively (x₄,y₄) and (x₅,y₅) in the current block; the at least twocontrol points used in the affine motion model used for the currentblock comprise at least two of control points whose coordinates arerespectively (x₄,y₄), (x₅,y₅), and (x₆,y₆) in the current block; or theat least two control points used in the affine motion model used for thecurrent block comprise at least two of control points whose coordinatesare respectively (x₄,y₄), (x₅,y₅), (x₆,y₆), and (x₇,y₇) in the currentblock; and vx₄ is a horizontal motion vector of the control point(x₄,y₄), vy₄ is a vertical motion vector of the control point (x₄,y₄);vx₅ is a horizontal motion vector of the control point (x₅,y₅), vy₅ is avertical motion vector of the control point (x₅,y₅), vx₆ is a horizontalmotion vector of the control point (x₆,y₆), vy₆ is a vertical motionvector of the control point (x₆,y₆), vx₇ is a horizontal motion vectorof the control point (x₇,y₇), and vy₇ is a vertical motion vector of thecontrol point (x₇,y₇).
 19. The apparatus according to claim 18, whereinto calculate the motion information of each subblock in the currentblock based on the location information of each subblock in the currentblock and the motion information and the location information of the atleast two control points used in the affine motion model used for thecurrent block, the instructions, which when executed by the one or moreprocessors, cause the one or more processors to calculate the motioninformation of each subblock in the current block with reference to thefollowing formula and based on the location information of each subblockin the current block and the motion information and the locationinformation of the at least two control points used in the affine motionmodel used for the current block: $\begin{matrix}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} - {\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}\mspace{14mu},{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{x_{6} - x_{4}} \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix}{\mspace{11mu}\;},{or}}  & \; \\\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{5} - {vx}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vx}_{6} - {vx}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vx}_{7} + {vx}_{4}} ) - ( {{vx}_{5} + {vx}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vx}_{4}}} \\{{vy} = {{\frac{{vy}_{5} - {vy}_{4}}{x_{5} - x_{4}} \times ( {x - x_{4}} )} + {\frac{{vy}_{6} - {vy}_{4}}{y_{6} - y_{4}} \times ( {y - y_{4}} )} + {\frac{( {{vy}_{7} + {vy}_{4}} ) - ( {{vy}_{5} + {vxy}_{6}} )}{( {x_{5} - x_{4}} ) \times ( {y_{6} - y_{4}} )} \times ( {x - x_{4}} ) \times ( {y - y_{4}} )} + {vy}_{4}}}\end{matrix},}  & \;\end{matrix}$ wherein vx is a horizontal motion vector of a subblockwhose coordinates are (x,y) in the current block, and vy is a verticalmotion vector of the subblock whose coordinates are (x,y) in the currentblock.
 20. The apparatus according to claim 11, wherein the apparatus isapplied to a video coding apparatus or a video decoding apparatus.
 21. Anon-transitory computer-readable storage medium having a computerprogram stored therein, which when executed by related hardware, causethe related hardware to perform operations, the operations comprising:determining a reference block of a current block, wherein the referenceblock and the current block are spatially adjacent, and the referenceblock is predicted by using an affine motion model; obtaining locationinformation and motion information of at least two feature points in thereference block, wherein the at least two feature points are located inat least two respective subblocks of the reference block in which atleast two control points in the reference block are located, the atleast two control points are used in the affine motion model used forreconstructing the reference block, and motion information of a subblockof the reference block in which a feature point is located is obtainedbased on motion information of a corresponding feature point;calculating motion information of each subblock in the current blockbased on the location information and the motion information of the atleast two feature points in the reference block; and performing motioncompensation prediction on each subblock in the current block based onthe motion information of each subblock in the current block, to obtaina prediction block of the current block; wherein calculating the motioninformation of each subblock in the current block comprises: calculatingthe motion information of each subblock in the current block based onthe location information and the motion information of the at least twofeature points in the reference block and location information of eachsubblock in the current block; wherein calculating the motioninformation of each subblock in the current block based on the locationinformation and the motion information of the at least two featurepoints in the reference block and the location information of eachsubblock in the current block comprises: calculating the motioninformation of each subblock in the current block with reference to thefollowing formula and based on the location information and the motioninformation of the at least two feature points in the reference blockand the location information of each subblock in the current block:$\{ {\begin{matrix}{{vx} = {{\frac{{vx_{1}} - {vx_{0}}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} - {\frac{{vy_{1}} - {vy_{0}}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx_{0}}}} \\{{vy} = {{\frac{{vy_{1}} - {vy_{0}}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx_{1}} - {vx_{0}}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy_{0}}}}\end{matrix},{{or}\text{}\{ {\begin{matrix}{{vx} = {{\frac{{vx}_{1} - {vx_{0}}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx_{2}} - {vx_{0}}}{x_{2}^{\prime} - x_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vx_{0}}}} \\{{vy} = {{\frac{{vy_{1}} - {vy_{0}}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy_{2}} - {vy_{0}}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} + {vy_{0}}}}\end{matrix},{{or}\{ {\begin{matrix}{{vx} = {{\frac{{vx_{1}} - {vx_{0}}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vx_{2}} - {vx_{0}}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vx_{3}} + {vx_{0}}} ) - ( {{vx_{1}} + {vx_{2}}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vx_{0}}} \\{{vy} = {{\frac{{vy}_{1^{-}}{vy}_{0}}{x_{1}^{\prime} - x_{0}^{\prime}} \times ( {x - x_{0}^{\prime}} )} + {\frac{{vy}_{2^{-}}{vy}_{0}}{y_{2}^{\prime} - y_{0}^{\prime}} \times ( {y - y_{0}^{\prime}} )} +}} \\{{\frac{( {{vy}_{3} + {vy}_{0}} ) - ( {{v\; y_{1}} + {vy}_{2}} )}{( {x_{1}^{\prime} - x_{0}^{\prime}} ) \times ( {y_{2}^{\prime} - y_{0}^{\prime}} )} \times ( {x - x_{0}^{\prime}} ) \times ( {y - y_{0}^{\prime}} )} + {vy}_{0}}\end{matrix},} }} }} $ wherein the at least twofeature points comprise the feature points whose coordinates are(x₀′,y₀′) and (x₁′,y₁′) in the reference block; or the at least twofeature points comprise at least two of the feature points whosecoordinates are (x₀′,y₀′), (x₁′,y₁′), and (x₂′,y₂′) in the referenceblock; or the at least two feature points comprise at least two of thefeature points whose coordinates are (x₀′,y₀′), (x₁′,y₁′), (x₂′,y₂′),and (x₃′,y₃′) in the reference block, wherein vx₀ is a horizontal motionvector of the feature point (x₀′,y₀′), vy₀ is a vertical motion vectorof the feature point (x₀′,y₀′); vx₁ is a horizontal motion vector of thefeature point (x₁′,y₁′), vy₁ is a vertical motion vector of the featurepoint (x₁′,y₁′), vy₂ is a vertical motion vector of the feature point(x₂′,y₂′), vx₂ is a horizontal motion vector of the feature point(x₂′,y₂′), vy₃ is a vertical motion vector of the feature point(x₃′,y₃′), and vx₃ is a horizontal motion vector of the feature point(x₃′,y₃′); and vx is a horizontal motion vector of a subblock whosecoordinates are (x,y) in the current block, and vy is a vertical motionvector of the subblock whose coordinates are (x,y) in the current block.